home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / AvantBrowser / asetup.exe / _data / webkit / resources.pak / Unnamed File 000122.unknown < prev    next >
Text File  |  2013-04-03  |  139KB  |  5,549 lines

  1.  
  2.  
  3.  
  4. onmessage = function(event) {
  5. if (!event.data.method)
  6. return;
  7.  
  8. self[event.data.method](event.data.params);
  9. };
  10.  
  11. function format(params)
  12. {
  13.  
  14. var indentString = params.indentString || "    ";
  15. var result = {};
  16.  
  17. if (params.mimeType === "text/html") {
  18. var formatter = new HTMLScriptFormatter(indentString);
  19. result = formatter.format(params.content);
  20. } else {
  21. result.mapping = { original: [0], formatted: [0] };
  22. result.content = formatScript(params.content, result.mapping, 0, 0, indentString);
  23. }
  24. postMessage(result);
  25. }
  26.  
  27. function getChunkCount(totalLength, chunkSize)
  28. {
  29. if (totalLength <= chunkSize)
  30. return 1;
  31.  
  32. var remainder = totalLength % chunkSize;
  33. var partialLength = totalLength - remainder;
  34. return (partialLength / chunkSize) + (remainder ? 1 : 0);
  35. }
  36.  
  37. function outline(params)
  38. {
  39. const chunkSize = 100000; 
  40. const totalLength = params.content.length;
  41. const lines = params.content.split("\n");
  42. const chunkCount = getChunkCount(totalLength, chunkSize);
  43. var outlineChunk = [];
  44. var previousIdentifier = null;
  45. var previousToken = null;
  46. var previousTokenType = null;
  47. var currentChunk = 1;
  48. var processedChunkCharacters = 0;
  49. var addedFunction = false;
  50. var isReadingArguments = false;
  51. var argumentsText = "";
  52. var currentFunction = null;
  53. var scriptTokenizer = new WebInspector.SourceJavaScriptTokenizer();
  54. scriptTokenizer.condition = scriptTokenizer.createInitialCondition();
  55.  
  56. for (var i = 0; i < lines.length; ++i) {
  57. var line = lines[i];
  58. var column = 0;
  59. scriptTokenizer.line = line;
  60. do {
  61. var newColumn = scriptTokenizer.nextToken(column);
  62. var tokenType = scriptTokenizer.tokenType;
  63. var tokenValue = line.substring(column, newColumn);
  64. if (tokenType === "javascript-ident") {
  65. previousIdentifier = tokenValue;
  66. if (tokenValue && previousToken === "function") {
  67.  
  68. currentFunction = { line: i, name: tokenValue };
  69. addedFunction = true;
  70. previousIdentifier = null;
  71. }
  72. } else if (tokenType === "javascript-keyword") {
  73. if (tokenValue === "function") {
  74. if (previousIdentifier && (previousToken === "=" || previousToken === ":")) {
  75.  
  76.  
  77. currentFunction = { line: i, name: previousIdentifier };
  78. addedFunction = true;
  79. previousIdentifier = null;
  80. }
  81. }
  82. } else if (tokenValue === "." && previousTokenType === "javascript-ident")
  83. previousIdentifier += ".";
  84. else if (tokenValue === "(" && addedFunction)
  85. isReadingArguments = true;
  86. if (isReadingArguments && tokenValue)
  87. argumentsText += tokenValue;
  88.  
  89. if (tokenValue === ")" && isReadingArguments) {
  90. addedFunction = false;
  91. isReadingArguments = false;
  92. currentFunction.arguments = argumentsText.replace(/,[\r\n\s]*/g, ", ").replace(/([^,])[\r\n\s]+/g, "$1");
  93. argumentsText = "";
  94. outlineChunk.push(currentFunction);
  95. }
  96.  
  97. if (tokenValue.trim().length) {
  98.  
  99. previousToken = tokenValue;
  100. previousTokenType = tokenType;
  101. }
  102. processedChunkCharacters += newColumn - column;
  103. column = newColumn;
  104.  
  105. if (processedChunkCharacters >= chunkSize) {
  106. postMessage({ chunk: outlineChunk, total: chunkCount, index: currentChunk++ });
  107. outlineChunk = [];
  108. processedChunkCharacters = 0;
  109. }
  110. } while (column < line.length);
  111. }
  112. postMessage({ chunk: outlineChunk, total: chunkCount, index: chunkCount });
  113. }
  114.  
  115. function formatScript(content, mapping, offset, formattedOffset, indentString)
  116. {
  117. var formattedContent;
  118. try {
  119. var tokenizer = new Tokenizer(content);
  120. var builder = new FormattedContentBuilder(tokenizer.content(), mapping, offset, formattedOffset, indentString);
  121. var formatter = new JavaScriptFormatter(tokenizer, builder);
  122. formatter.format();
  123. formattedContent = builder.content();
  124. } catch (e) {
  125. formattedContent = content;
  126. }
  127. return formattedContent;
  128. }
  129.  
  130. WebInspector = {};
  131.  
  132. Array.prototype.keySet = function()
  133. {
  134. var keys = {};
  135. for (var i = 0; i < this.length; ++i)
  136. keys[this[i]] = true;
  137. return keys;
  138. };
  139.  
  140.  
  141.  
  142.  
  143.  
  144. WebInspector.SourceTokenizer = function()
  145. {
  146. }
  147.  
  148. WebInspector.SourceTokenizer.prototype = {
  149. set line(line) {
  150. this._line = line;
  151. },
  152.  
  153. set condition(condition)
  154. {
  155. this._condition = condition;
  156. },
  157.  
  158. get condition()
  159. {
  160. return this._condition;
  161. },
  162.  
  163. getLexCondition: function()
  164. {
  165. return this.condition.lexCondition;
  166. },
  167.  
  168. setLexCondition: function(lexCondition)
  169. {
  170. this.condition.lexCondition = lexCondition;
  171. },
  172.  
  173. _charAt: function(cursor)
  174. {
  175. return cursor < this._line.length ? this._line.charAt(cursor) : "\n";
  176. },
  177.  
  178. createInitialCondition: function()
  179. {
  180. },
  181.  
  182. nextToken: function(cursor)
  183. {
  184. }
  185. }
  186.  
  187.  
  188. WebInspector.SourceTokenizer.Registry = function() {
  189. this._tokenizers = {};
  190. this._tokenizerConstructors = {
  191. "text/css": "SourceCSSTokenizer",
  192. "text/html": "SourceHTMLTokenizer",
  193. "text/javascript": "SourceJavaScriptTokenizer",
  194. "text/x-scss": "SourceCSSTokenizer"
  195. };
  196. }
  197.  
  198. WebInspector.SourceTokenizer.Registry.getInstance = function()
  199. {
  200. if (!WebInspector.SourceTokenizer.Registry._instance)
  201. WebInspector.SourceTokenizer.Registry._instance = new WebInspector.SourceTokenizer.Registry();
  202. return WebInspector.SourceTokenizer.Registry._instance;
  203. }
  204.  
  205. WebInspector.SourceTokenizer.Registry.prototype = {
  206. getTokenizer: function(mimeType)
  207. {
  208. if (!this._tokenizerConstructors[mimeType])
  209. return null;
  210. var tokenizerClass = this._tokenizerConstructors[mimeType];
  211. var tokenizer = this._tokenizers[tokenizerClass];
  212. if (!tokenizer) {
  213. tokenizer = new WebInspector[tokenizerClass]();
  214. this._tokenizers[tokenizerClass] = tokenizer;
  215. }
  216. return tokenizer;
  217. }
  218. }
  219. ;
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236. WebInspector.SourceHTMLTokenizer = function()
  237. {
  238. WebInspector.SourceTokenizer.call(this);
  239.  
  240.  
  241. this._lexConditions = {
  242. INITIAL: 0,
  243. COMMENT: 1,
  244. DOCTYPE: 2,
  245. TAG: 3,
  246. DSTRING: 4,
  247. SSTRING: 5
  248. };
  249. this.case_INITIAL = 1000;
  250. this.case_COMMENT = 1001;
  251. this.case_DOCTYPE = 1002;
  252. this.case_TAG = 1003;
  253. this.case_DSTRING = 1004;
  254. this.case_SSTRING = 1005;
  255.  
  256. this._parseConditions = {
  257. INITIAL: 0,
  258. ATTRIBUTE: 1,
  259. ATTRIBUTE_VALUE: 2,
  260. LINKIFY: 4,
  261. A_NODE: 8,
  262. SCRIPT: 16,
  263. STYLE: 32
  264. };
  265.  
  266. this.condition = this.createInitialCondition();
  267. }
  268.  
  269. WebInspector.SourceHTMLTokenizer.prototype = {
  270. createInitialCondition: function()
  271. {
  272. return { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
  273. },
  274.  
  275. set line(line) {
  276. if (this._condition.internalJavaScriptTokenizerCondition) {
  277. var match = /<\/script/i.exec(line);
  278. if (match) {
  279. this._internalJavaScriptTokenizer.line = line.substring(0, match.index);
  280. } else
  281. this._internalJavaScriptTokenizer.line = line;
  282. } else if (this._condition.internalCSSTokenizerCondition) {
  283. var match = /<\/style/i.exec(line);
  284. if (match) {
  285. this._internalCSSTokenizer.line = line.substring(0, match.index);
  286. } else
  287. this._internalCSSTokenizer.line = line;
  288. }
  289. this._line = line;
  290. },
  291.  
  292. _isExpectingAttribute: function()
  293. {
  294. return this._condition.parseCondition & this._parseConditions.ATTRIBUTE;
  295. },
  296.  
  297. _isExpectingAttributeValue: function()
  298. {
  299. return this._condition.parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
  300. },
  301.  
  302. _setExpectingAttribute: function()
  303. {
  304. if (this._isExpectingAttributeValue())
  305. this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
  306. this._condition.parseCondition |= this._parseConditions.ATTRIBUTE;
  307. },
  308.  
  309. _setExpectingAttributeValue: function()
  310. {
  311. if (this._isExpectingAttribute())
  312. this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE;
  313. this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
  314. },
  315.  
  316.  
  317. _stringToken: function(cursor, stringEnds)
  318. {
  319. if (!this._isExpectingAttributeValue()) {
  320. this.tokenType = null;
  321. return cursor;
  322. }
  323. this.tokenType = this._attrValueTokenType();
  324. if (stringEnds)
  325. this._setExpectingAttribute();
  326. return cursor;
  327. },
  328.  
  329. _attrValueTokenType: function()
  330. {
  331. if (this._condition.parseCondition & this._parseConditions.LINKIFY) {
  332. if (this._condition.parseCondition & this._parseConditions.A_NODE)
  333. return "html-external-link";
  334. return "html-resource-link";
  335. }
  336. return "html-attribute-value";
  337. },
  338.  
  339. get _internalJavaScriptTokenizer()
  340. {
  341. return WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/javascript");
  342. },
  343.  
  344. get _internalCSSTokenizer()
  345. {
  346. return WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/css");
  347. },
  348.  
  349. scriptStarted: function(cursor)
  350. {
  351. this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.createInitialCondition();
  352. },
  353.  
  354. scriptEnded: function(cursor)
  355. {
  356. },
  357.  
  358. styleSheetStarted: function(cursor)
  359. {
  360. this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.createInitialCondition();
  361. },
  362.  
  363. styleSheetEnded: function(cursor)
  364. {
  365. },
  366.  
  367. nextToken: function(cursor)
  368. {
  369. if (this._condition.internalJavaScriptTokenizerCondition) {
  370.  
  371. this.line = this._line;
  372. if (cursor !== this._internalJavaScriptTokenizer._line.length) {
  373.  
  374. this._internalJavaScriptTokenizer.condition = this._condition.internalJavaScriptTokenizerCondition;
  375. var result = this._internalJavaScriptTokenizer.nextToken(cursor);
  376. this.tokenType = this._internalJavaScriptTokenizer.tokenType;
  377. this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.condition;
  378. return result;
  379. } else if (cursor !== this._line.length)
  380. delete this._condition.internalJavaScriptTokenizerCondition;
  381. } else if (this._condition.internalCSSTokenizerCondition) {
  382.  
  383. this.line = this._line;
  384. if (cursor !== this._internalCSSTokenizer._line.length) {
  385.  
  386. this._internalCSSTokenizer.condition = this._condition.internalCSSTokenizerCondition;
  387. var result = this._internalCSSTokenizer.nextToken(cursor);
  388. this.tokenType = this._internalCSSTokenizer.tokenType;
  389. this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.condition;
  390. return result;
  391. } else if (cursor !== this._line.length)
  392. delete this._condition.internalCSSTokenizerCondition;
  393. }
  394.  
  395. var cursorOnEnter = cursor;
  396. var gotoCase = 1;
  397. var YYMARKER;
  398. while (1) {
  399. switch (gotoCase)
  400.  
  401.  
  402. {
  403. case 1: var yych;
  404. var yyaccept = 0;
  405. if (this.getLexCondition() < 3) {
  406. if (this.getLexCondition() < 1) {
  407. { gotoCase = this.case_INITIAL; continue; };
  408. } else {
  409. if (this.getLexCondition() < 2) {
  410. { gotoCase = this.case_COMMENT; continue; };
  411. } else {
  412. { gotoCase = this.case_DOCTYPE; continue; };
  413. }
  414. }
  415. } else {
  416. if (this.getLexCondition() < 4) {
  417. { gotoCase = this.case_TAG; continue; };
  418. } else {
  419. if (this.getLexCondition() < 5) {
  420. { gotoCase = this.case_DSTRING; continue; };
  421. } else {
  422. { gotoCase = this.case_SSTRING; continue; };
  423. }
  424. }
  425. }
  426.  
  427. case this.case_COMMENT:
  428.  
  429. yych = this._charAt(cursor);
  430. if (yych <= '\f') {
  431. if (yych == '\n') { gotoCase = 4; continue; };
  432. { gotoCase = 3; continue; };
  433. } else {
  434. if (yych <= '\r') { gotoCase = 4; continue; };
  435. if (yych == '-') { gotoCase = 6; continue; };
  436. { gotoCase = 3; continue; };
  437. }
  438. case 2:
  439. { this.tokenType = "html-comment"; return cursor; }
  440. case 3:
  441. yyaccept = 0;
  442. yych = this._charAt(YYMARKER = ++cursor);
  443. { gotoCase = 9; continue; };
  444. case 4:
  445. ++cursor;
  446. case 5:
  447. { this.tokenType = null; return cursor; }
  448. case 6:
  449. yyaccept = 1;
  450. yych = this._charAt(YYMARKER = ++cursor);
  451. if (yych != '-') { gotoCase = 5; continue; };
  452. case 7:
  453. ++cursor;
  454. yych = this._charAt(cursor);
  455. if (yych == '>') { gotoCase = 10; continue; };
  456. case 8:
  457. yyaccept = 0;
  458. YYMARKER = ++cursor;
  459. yych = this._charAt(cursor);
  460. case 9:
  461. if (yych <= '\f') {
  462. if (yych == '\n') { gotoCase = 2; continue; };
  463. { gotoCase = 8; continue; };
  464. } else {
  465. if (yych <= '\r') { gotoCase = 2; continue; };
  466. if (yych == '-') { gotoCase = 12; continue; };
  467. { gotoCase = 8; continue; };
  468. }
  469. case 10:
  470. ++cursor;
  471. this.setLexCondition(this._lexConditions.INITIAL);
  472. { this.tokenType = "html-comment"; return cursor; }
  473. case 12:
  474. ++cursor;
  475. yych = this._charAt(cursor);
  476. if (yych == '-') { gotoCase = 7; continue; };
  477. cursor = YYMARKER;
  478. if (yyaccept <= 0) {
  479. { gotoCase = 2; continue; };
  480. } else {
  481. { gotoCase = 5; continue; };
  482. }
  483.  
  484. case this.case_DOCTYPE:
  485. yych = this._charAt(cursor);
  486. if (yych <= '\f') {
  487. if (yych == '\n') { gotoCase = 18; continue; };
  488. { gotoCase = 17; continue; };
  489. } else {
  490. if (yych <= '\r') { gotoCase = 18; continue; };
  491. if (yych == '>') { gotoCase = 20; continue; };
  492. { gotoCase = 17; continue; };
  493. }
  494. case 16:
  495. { this.tokenType = "html-doctype"; return cursor; }
  496. case 17:
  497. yych = this._charAt(++cursor);
  498. { gotoCase = 23; continue; };
  499. case 18:
  500. ++cursor;
  501. { this.tokenType = null; return cursor; }
  502. case 20:
  503. ++cursor;
  504. this.setLexCondition(this._lexConditions.INITIAL);
  505. { this.tokenType = "html-doctype"; return cursor; }
  506. case 22:
  507. ++cursor;
  508. yych = this._charAt(cursor);
  509. case 23:
  510. if (yych <= '\f') {
  511. if (yych == '\n') { gotoCase = 16; continue; };
  512. { gotoCase = 22; continue; };
  513. } else {
  514. if (yych <= '\r') { gotoCase = 16; continue; };
  515. if (yych == '>') { gotoCase = 16; continue; };
  516. { gotoCase = 22; continue; };
  517. }
  518.  
  519. case this.case_DSTRING:
  520. yych = this._charAt(cursor);
  521. if (yych <= '\f') {
  522. if (yych == '\n') { gotoCase = 28; continue; };
  523. { gotoCase = 27; continue; };
  524. } else {
  525. if (yych <= '\r') { gotoCase = 28; continue; };
  526. if (yych == '"') { gotoCase = 30; continue; };
  527. { gotoCase = 27; continue; };
  528. }
  529. case 26:
  530. { return this._stringToken(cursor); }
  531. case 27:
  532. yych = this._charAt(++cursor);
  533. { gotoCase = 34; continue; };
  534. case 28:
  535. ++cursor;
  536. { this.tokenType = null; return cursor; }
  537. case 30:
  538. ++cursor;
  539. case 31:
  540. this.setLexCondition(this._lexConditions.TAG);
  541. { return this._stringToken(cursor, true); }
  542. case 32:
  543. yych = this._charAt(++cursor);
  544. { gotoCase = 31; continue; };
  545. case 33:
  546. ++cursor;
  547. yych = this._charAt(cursor);
  548. case 34:
  549. if (yych <= '\f') {
  550. if (yych == '\n') { gotoCase = 26; continue; };
  551. { gotoCase = 33; continue; };
  552. } else {
  553. if (yych <= '\r') { gotoCase = 26; continue; };
  554. if (yych == '"') { gotoCase = 32; continue; };
  555. { gotoCase = 33; continue; };
  556. }
  557.  
  558. case this.case_INITIAL:
  559. yych = this._charAt(cursor);
  560. if (yych == '<') { gotoCase = 39; continue; };
  561. ++cursor;
  562. { this.tokenType = null; return cursor; }
  563. case 39:
  564. yyaccept = 0;
  565. yych = this._charAt(YYMARKER = ++cursor);
  566. if (yych <= '/') {
  567. if (yych == '!') { gotoCase = 44; continue; };
  568. if (yych >= '/') { gotoCase = 41; continue; };
  569. } else {
  570. if (yych <= 'S') {
  571. if (yych >= 'S') { gotoCase = 42; continue; };
  572. } else {
  573. if (yych == 's') { gotoCase = 42; continue; };
  574. }
  575. }
  576. case 40:
  577. this.setLexCondition(this._lexConditions.TAG);
  578. {
  579. if (this._condition.parseCondition & (this._parseConditions.SCRIPT | this._parseConditions.STYLE)) {
  580.  
  581. this.setLexCondition(this._lexConditions.INITIAL);
  582. this.tokenType = null;
  583. return cursor;
  584. }
  585.  
  586. this._condition.parseCondition = this._parseConditions.INITIAL;
  587. this.tokenType = "html-tag";
  588. return cursor;
  589. }
  590. case 41:
  591. yyaccept = 0;
  592. yych = this._charAt(YYMARKER = ++cursor);
  593. if (yych == 'S') { gotoCase = 73; continue; };
  594. if (yych == 's') { gotoCase = 73; continue; };
  595. { gotoCase = 40; continue; };
  596. case 42:
  597. yych = this._charAt(++cursor);
  598. if (yych <= 'T') {
  599. if (yych == 'C') { gotoCase = 62; continue; };
  600. if (yych >= 'T') { gotoCase = 63; continue; };
  601. } else {
  602. if (yych <= 'c') {
  603. if (yych >= 'c') { gotoCase = 62; continue; };
  604. } else {
  605. if (yych == 't') { gotoCase = 63; continue; };
  606. }
  607. }
  608. case 43:
  609. cursor = YYMARKER;
  610. { gotoCase = 40; continue; };
  611. case 44:
  612. yych = this._charAt(++cursor);
  613. if (yych <= 'C') {
  614. if (yych != '-') { gotoCase = 43; continue; };
  615. } else {
  616. if (yych <= 'D') { gotoCase = 46; continue; };
  617. if (yych == 'd') { gotoCase = 46; continue; };
  618. { gotoCase = 43; continue; };
  619. }
  620. yych = this._charAt(++cursor);
  621. if (yych == '-') { gotoCase = 54; continue; };
  622. { gotoCase = 43; continue; };
  623. case 46:
  624. yych = this._charAt(++cursor);
  625. if (yych == 'O') { gotoCase = 47; continue; };
  626. if (yych != 'o') { gotoCase = 43; continue; };
  627. case 47:
  628. yych = this._charAt(++cursor);
  629. if (yych == 'C') { gotoCase = 48; continue; };
  630. if (yych != 'c') { gotoCase = 43; continue; };
  631. case 48:
  632. yych = this._charAt(++cursor);
  633. if (yych == 'T') { gotoCase = 49; continue; };
  634. if (yych != 't') { gotoCase = 43; continue; };
  635. case 49:
  636. yych = this._charAt(++cursor);
  637. if (yych == 'Y') { gotoCase = 50; continue; };
  638. if (yych != 'y') { gotoCase = 43; continue; };
  639. case 50:
  640. yych = this._charAt(++cursor);
  641. if (yych == 'P') { gotoCase = 51; continue; };
  642. if (yych != 'p') { gotoCase = 43; continue; };
  643. case 51:
  644. yych = this._charAt(++cursor);
  645. if (yych == 'E') { gotoCase = 52; continue; };
  646. if (yych != 'e') { gotoCase = 43; continue; };
  647. case 52:
  648. ++cursor;
  649. this.setLexCondition(this._lexConditions.DOCTYPE);
  650. { this.tokenType = "html-doctype"; return cursor; }
  651. case 54:
  652. ++cursor;
  653. yych = this._charAt(cursor);
  654. if (yych <= '\f') {
  655. if (yych == '\n') { gotoCase = 57; continue; };
  656. { gotoCase = 54; continue; };
  657. } else {
  658. if (yych <= '\r') { gotoCase = 57; continue; };
  659. if (yych != '-') { gotoCase = 54; continue; };
  660. }
  661. ++cursor;
  662. yych = this._charAt(cursor);
  663. if (yych == '-') { gotoCase = 59; continue; };
  664. { gotoCase = 43; continue; };
  665. case 57:
  666. ++cursor;
  667. this.setLexCondition(this._lexConditions.COMMENT);
  668. { this.tokenType = "html-comment"; return cursor; }
  669. case 59:
  670. ++cursor;
  671. yych = this._charAt(cursor);
  672. if (yych != '>') { gotoCase = 54; continue; };
  673. ++cursor;
  674. { this.tokenType = "html-comment"; return cursor; }
  675. case 62:
  676. yych = this._charAt(++cursor);
  677. if (yych == 'R') { gotoCase = 68; continue; };
  678. if (yych == 'r') { gotoCase = 68; continue; };
  679. { gotoCase = 43; continue; };
  680. case 63:
  681. yych = this._charAt(++cursor);
  682. if (yych == 'Y') { gotoCase = 64; continue; };
  683. if (yych != 'y') { gotoCase = 43; continue; };
  684. case 64:
  685. yych = this._charAt(++cursor);
  686. if (yych == 'L') { gotoCase = 65; continue; };
  687. if (yych != 'l') { gotoCase = 43; continue; };
  688. case 65:
  689. yych = this._charAt(++cursor);
  690. if (yych == 'E') { gotoCase = 66; continue; };
  691. if (yych != 'e') { gotoCase = 43; continue; };
  692. case 66:
  693. ++cursor;
  694. this.setLexCondition(this._lexConditions.TAG);
  695. {
  696. if (this._condition.parseCondition & this._parseConditions.STYLE) {
  697.  
  698. this.setLexCondition(this._lexConditions.INITIAL);
  699. this.tokenType = null;
  700. return cursor;
  701. }
  702. this.tokenType = "html-tag";
  703. this._condition.parseCondition = this._parseConditions.STYLE;
  704. this._setExpectingAttribute();
  705. return cursor;
  706. }
  707. case 68:
  708. yych = this._charAt(++cursor);
  709. if (yych == 'I') { gotoCase = 69; continue; };
  710. if (yych != 'i') { gotoCase = 43; continue; };
  711. case 69:
  712. yych = this._charAt(++cursor);
  713. if (yych == 'P') { gotoCase = 70; continue; };
  714. if (yych != 'p') { gotoCase = 43; continue; };
  715. case 70:
  716. yych = this._charAt(++cursor);
  717. if (yych == 'T') { gotoCase = 71; continue; };
  718. if (yych != 't') { gotoCase = 43; continue; };
  719. case 71:
  720. ++cursor;
  721. this.setLexCondition(this._lexConditions.TAG);
  722. {
  723. if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
  724.  
  725. this.setLexCondition(this._lexConditions.INITIAL);
  726. this.tokenType = null;
  727. return cursor;
  728. }
  729. this.tokenType = "html-tag";
  730. this._condition.parseCondition = this._parseConditions.SCRIPT;
  731. this._setExpectingAttribute();
  732. return cursor;
  733. }
  734. case 73:
  735. yych = this._charAt(++cursor);
  736. if (yych <= 'T') {
  737. if (yych == 'C') { gotoCase = 75; continue; };
  738. if (yych <= 'S') { gotoCase = 43; continue; };
  739. } else {
  740. if (yych <= 'c') {
  741. if (yych <= 'b') { gotoCase = 43; continue; };
  742. { gotoCase = 75; continue; };
  743. } else {
  744. if (yych != 't') { gotoCase = 43; continue; };
  745. }
  746. }
  747. yych = this._charAt(++cursor);
  748. if (yych == 'Y') { gotoCase = 81; continue; };
  749. if (yych == 'y') { gotoCase = 81; continue; };
  750. { gotoCase = 43; continue; };
  751. case 75:
  752. yych = this._charAt(++cursor);
  753. if (yych == 'R') { gotoCase = 76; continue; };
  754. if (yych != 'r') { gotoCase = 43; continue; };
  755. case 76:
  756. yych = this._charAt(++cursor);
  757. if (yych == 'I') { gotoCase = 77; continue; };
  758. if (yych != 'i') { gotoCase = 43; continue; };
  759. case 77:
  760. yych = this._charAt(++cursor);
  761. if (yych == 'P') { gotoCase = 78; continue; };
  762. if (yych != 'p') { gotoCase = 43; continue; };
  763. case 78:
  764. yych = this._charAt(++cursor);
  765. if (yych == 'T') { gotoCase = 79; continue; };
  766. if (yych != 't') { gotoCase = 43; continue; };
  767. case 79:
  768. ++cursor;
  769. this.setLexCondition(this._lexConditions.TAG);
  770. {
  771. this.tokenType = "html-tag";
  772. this._condition.parseCondition = this._parseConditions.INITIAL;
  773. this.scriptEnded(cursor - 8);
  774. return cursor;
  775. }
  776. case 81:
  777. yych = this._charAt(++cursor);
  778. if (yych == 'L') { gotoCase = 82; continue; };
  779. if (yych != 'l') { gotoCase = 43; continue; };
  780. case 82:
  781. yych = this._charAt(++cursor);
  782. if (yych == 'E') { gotoCase = 83; continue; };
  783. if (yych != 'e') { gotoCase = 43; continue; };
  784. case 83:
  785. ++cursor;
  786. this.setLexCondition(this._lexConditions.TAG);
  787. {
  788. this.tokenType = "html-tag";
  789. this._condition.parseCondition = this._parseConditions.INITIAL;
  790. this.styleSheetEnded(cursor - 7);
  791. return cursor;
  792. }
  793.  
  794. case this.case_SSTRING:
  795. yych = this._charAt(cursor);
  796. if (yych <= '\f') {
  797. if (yych == '\n') { gotoCase = 89; continue; };
  798. { gotoCase = 88; continue; };
  799. } else {
  800. if (yych <= '\r') { gotoCase = 89; continue; };
  801. if (yych == '\'') { gotoCase = 91; continue; };
  802. { gotoCase = 88; continue; };
  803. }
  804. case 87:
  805. { return this._stringToken(cursor); }
  806. case 88:
  807. yych = this._charAt(++cursor);
  808. { gotoCase = 95; continue; };
  809. case 89:
  810. ++cursor;
  811. { this.tokenType = null; return cursor; }
  812. case 91:
  813. ++cursor;
  814. case 92:
  815. this.setLexCondition(this._lexConditions.TAG);
  816. { return this._stringToken(cursor, true); }
  817. case 93:
  818. yych = this._charAt(++cursor);
  819. { gotoCase = 92; continue; };
  820. case 94:
  821. ++cursor;
  822. yych = this._charAt(cursor);
  823. case 95:
  824. if (yych <= '\f') {
  825. if (yych == '\n') { gotoCase = 87; continue; };
  826. { gotoCase = 94; continue; };
  827. } else {
  828. if (yych <= '\r') { gotoCase = 87; continue; };
  829. if (yych == '\'') { gotoCase = 93; continue; };
  830. { gotoCase = 94; continue; };
  831. }
  832.  
  833. case this.case_TAG:
  834. yych = this._charAt(cursor);
  835. if (yych <= '&') {
  836. if (yych <= '\r') {
  837. if (yych == '\n') { gotoCase = 100; continue; };
  838. if (yych >= '\r') { gotoCase = 100; continue; };
  839. } else {
  840. if (yych <= ' ') {
  841. if (yych >= ' ') { gotoCase = 100; continue; };
  842. } else {
  843. if (yych == '"') { gotoCase = 102; continue; };
  844. }
  845. }
  846. } else {
  847. if (yych <= '>') {
  848. if (yych <= ';') {
  849. if (yych <= '\'') { gotoCase = 103; continue; };
  850. } else {
  851. if (yych <= '<') { gotoCase = 100; continue; };
  852. if (yych <= '=') { gotoCase = 104; continue; };
  853. { gotoCase = 106; continue; };
  854. }
  855. } else {
  856. if (yych <= '[') {
  857. if (yych >= '[') { gotoCase = 100; continue; };
  858. } else {
  859. if (yych == ']') { gotoCase = 100; continue; };
  860. }
  861. }
  862. }
  863. ++cursor;
  864. yych = this._charAt(cursor);
  865. { gotoCase = 119; continue; };
  866. case 99:
  867. {
  868. if (this._condition.parseCondition === this._parseConditions.SCRIPT || this._condition.parseCondition === this._parseConditions.STYLE) {
  869.  
  870. this.tokenType = null;
  871. return cursor;
  872. }
  873.  
  874. if (this._condition.parseCondition === this._parseConditions.INITIAL) {
  875. this.tokenType = "html-tag";
  876. this._setExpectingAttribute();
  877. var token = this._line.substring(cursorOnEnter, cursor);
  878. if (token === "a")
  879. this._condition.parseCondition |= this._parseConditions.A_NODE;
  880. else if (this._condition.parseCondition & this._parseConditions.A_NODE)
  881. this._condition.parseCondition ^= this._parseConditions.A_NODE;
  882. } else if (this._isExpectingAttribute()) {
  883. var token = this._line.substring(cursorOnEnter, cursor);
  884. if (token === "href" || token === "src")
  885. this._condition.parseCondition |= this._parseConditions.LINKIFY;
  886. else if (this._condition.parseCondition |= this._parseConditions.LINKIFY)
  887. this._condition.parseCondition ^= this._parseConditions.LINKIFY;
  888. this.tokenType = "html-attribute-name";
  889. } else if (this._isExpectingAttributeValue())
  890. this.tokenType = this._attrValueTokenType();
  891. else
  892. this.tokenType = null;
  893. return cursor;
  894. }
  895. case 100:
  896. ++cursor;
  897. { this.tokenType = null; return cursor; }
  898. case 102:
  899. yyaccept = 0;
  900. yych = this._charAt(YYMARKER = ++cursor);
  901. { gotoCase = 115; continue; };
  902. case 103:
  903. yyaccept = 0;
  904. yych = this._charAt(YYMARKER = ++cursor);
  905. { gotoCase = 109; continue; };
  906. case 104:
  907. ++cursor;
  908. {
  909. if (this._isExpectingAttribute())
  910. this._setExpectingAttributeValue();
  911. this.tokenType = null;
  912. return cursor;
  913. }
  914. case 106:
  915. ++cursor;
  916. this.setLexCondition(this._lexConditions.INITIAL);
  917. {
  918. this.tokenType = "html-tag";
  919. if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
  920. this.scriptStarted(cursor);
  921.  
  922. return cursor;
  923. }
  924.  
  925. if (this._condition.parseCondition & this._parseConditions.STYLE) {
  926. this.styleSheetStarted(cursor);
  927.  
  928. return cursor;
  929. }
  930.  
  931. this._condition.parseCondition = this._parseConditions.INITIAL;
  932. return cursor;
  933. }
  934. case 108:
  935. ++cursor;
  936. yych = this._charAt(cursor);
  937. case 109:
  938. if (yych <= '\f') {
  939. if (yych != '\n') { gotoCase = 108; continue; };
  940. } else {
  941. if (yych <= '\r') { gotoCase = 110; continue; };
  942. if (yych == '\'') { gotoCase = 112; continue; };
  943. { gotoCase = 108; continue; };
  944. }
  945. case 110:
  946. ++cursor;
  947. this.setLexCondition(this._lexConditions.SSTRING);
  948. { return this._stringToken(cursor); }
  949. case 112:
  950. ++cursor;
  951. { return this._stringToken(cursor, true); }
  952. case 114:
  953. ++cursor;
  954. yych = this._charAt(cursor);
  955. case 115:
  956. if (yych <= '\f') {
  957. if (yych != '\n') { gotoCase = 114; continue; };
  958. } else {
  959. if (yych <= '\r') { gotoCase = 116; continue; };
  960. if (yych == '"') { gotoCase = 112; continue; };
  961. { gotoCase = 114; continue; };
  962. }
  963. case 116:
  964. ++cursor;
  965. this.setLexCondition(this._lexConditions.DSTRING);
  966. { return this._stringToken(cursor); }
  967. case 118:
  968. ++cursor;
  969. yych = this._charAt(cursor);
  970. case 119:
  971. if (yych <= '"') {
  972. if (yych <= '\r') {
  973. if (yych == '\n') { gotoCase = 99; continue; };
  974. if (yych <= '\f') { gotoCase = 118; continue; };
  975. { gotoCase = 99; continue; };
  976. } else {
  977. if (yych == ' ') { gotoCase = 99; continue; };
  978. if (yych <= '!') { gotoCase = 118; continue; };
  979. { gotoCase = 99; continue; };
  980. }
  981. } else {
  982. if (yych <= '>') {
  983. if (yych == '\'') { gotoCase = 99; continue; };
  984. if (yych <= ';') { gotoCase = 118; continue; };
  985. { gotoCase = 99; continue; };
  986. } else {
  987. if (yych <= '[') {
  988. if (yych <= 'Z') { gotoCase = 118; continue; };
  989. { gotoCase = 99; continue; };
  990. } else {
  991. if (yych == ']') { gotoCase = 99; continue; };
  992. { gotoCase = 118; continue; };
  993. }
  994. }
  995. }
  996. }
  997.  
  998. }
  999. },
  1000.  
  1001. __proto__: WebInspector.SourceTokenizer.prototype
  1002. }
  1003. ;
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. WebInspector.SourceJavaScriptTokenizer = function()
  1011. {
  1012. WebInspector.SourceTokenizer.call(this);
  1013.  
  1014. this._lexConditions = {
  1015. DIV: 0,
  1016. NODIV: 1,
  1017. COMMENT: 2,
  1018. DSTRING: 3,
  1019. SSTRING: 4,
  1020. REGEX: 5
  1021. };
  1022.  
  1023. this.case_DIV = 1000;
  1024. this.case_NODIV = 1001;
  1025. this.case_COMMENT = 1002;
  1026. this.case_DSTRING = 1003;
  1027. this.case_SSTRING = 1004;
  1028. this.case_REGEX = 1005;
  1029.  
  1030. this.condition = this.createInitialCondition();
  1031. }
  1032.  
  1033. WebInspector.SourceJavaScriptTokenizer.Keywords = [
  1034. "null", "true", "false", "break", "case", "catch", "const", "default", "finally", "for",
  1035. "instanceof", "new", "var", "continue", "function", "return", "void", "delete", "if",
  1036. "this", "do", "while", "else", "in", "switch", "throw", "try", "typeof", "debugger",
  1037. "class", "enum", "export", "extends", "import", "super", "get", "set", "with"
  1038. ].keySet();
  1039.  
  1040. WebInspector.SourceJavaScriptTokenizer.prototype = {
  1041. createInitialCondition: function()
  1042. {
  1043. return { lexCondition: this._lexConditions.NODIV };
  1044. },
  1045.  
  1046. nextToken: function(cursor)
  1047. {
  1048. var cursorOnEnter = cursor;
  1049. var gotoCase = 1;
  1050. var YYMARKER;
  1051. while (1) {
  1052. switch (gotoCase)
  1053.  
  1054.  
  1055. {
  1056. case 1: var yych;
  1057. var yyaccept = 0;
  1058. if (this.getLexCondition() < 3) {
  1059. if (this.getLexCondition() < 1) {
  1060. { gotoCase = this.case_DIV; continue; };
  1061. } else {
  1062. if (this.getLexCondition() < 2) {
  1063. { gotoCase = this.case_NODIV; continue; };
  1064. } else {
  1065. { gotoCase = this.case_COMMENT; continue; };
  1066. }
  1067. }
  1068. } else {
  1069. if (this.getLexCondition() < 4) {
  1070. { gotoCase = this.case_DSTRING; continue; };
  1071. } else {
  1072. if (this.getLexCondition() < 5) {
  1073. { gotoCase = this.case_SSTRING; continue; };
  1074. } else {
  1075. { gotoCase = this.case_REGEX; continue; };
  1076. }
  1077. }
  1078. }
  1079.  
  1080. case this.case_COMMENT:
  1081.  
  1082. yych = this._charAt(cursor);
  1083. if (yych <= '\f') {
  1084. if (yych == '\n') { gotoCase = 4; continue; };
  1085. { gotoCase = 3; continue; };
  1086. } else {
  1087. if (yych <= '\r') { gotoCase = 4; continue; };
  1088. if (yych == '*') { gotoCase = 6; continue; };
  1089. { gotoCase = 3; continue; };
  1090. }
  1091. case 2:
  1092. { this.tokenType = "javascript-comment"; return cursor; }
  1093. case 3:
  1094. yyaccept = 0;
  1095. yych = this._charAt(YYMARKER = ++cursor);
  1096. { gotoCase = 12; continue; };
  1097. case 4:
  1098. ++cursor;
  1099. { this.tokenType = null; return cursor; }
  1100. case 6:
  1101. yyaccept = 1;
  1102. yych = this._charAt(YYMARKER = ++cursor);
  1103. if (yych == '*') { gotoCase = 9; continue; };
  1104. if (yych != '/') { gotoCase = 11; continue; };
  1105. case 7:
  1106. ++cursor;
  1107. this.setLexCondition(this._lexConditions.NODIV);
  1108. { this.tokenType = "javascript-comment"; return cursor; }
  1109. case 9:
  1110. ++cursor;
  1111. yych = this._charAt(cursor);
  1112. if (yych == '*') { gotoCase = 9; continue; };
  1113. if (yych == '/') { gotoCase = 7; continue; };
  1114. case 11:
  1115. yyaccept = 0;
  1116. YYMARKER = ++cursor;
  1117. yych = this._charAt(cursor);
  1118. case 12:
  1119. if (yych <= '\f') {
  1120. if (yych == '\n') { gotoCase = 2; continue; };
  1121. { gotoCase = 11; continue; };
  1122. } else {
  1123. if (yych <= '\r') { gotoCase = 2; continue; };
  1124. if (yych == '*') { gotoCase = 9; continue; };
  1125. { gotoCase = 11; continue; };
  1126. }
  1127.  
  1128. case this.case_DIV:
  1129. yych = this._charAt(cursor);
  1130. if (yych <= '9') {
  1131. if (yych <= '(') {
  1132. if (yych <= '#') {
  1133. if (yych <= ' ') { gotoCase = 15; continue; };
  1134. if (yych <= '!') { gotoCase = 17; continue; };
  1135. if (yych <= '"') { gotoCase = 19; continue; };
  1136. } else {
  1137. if (yych <= '%') {
  1138. if (yych <= '$') { gotoCase = 20; continue; };
  1139. { gotoCase = 22; continue; };
  1140. } else {
  1141. if (yych <= '&') { gotoCase = 23; continue; };
  1142. if (yych <= '\'') { gotoCase = 24; continue; };
  1143. { gotoCase = 25; continue; };
  1144. }
  1145. }
  1146. } else {
  1147. if (yych <= ',') {
  1148. if (yych <= ')') { gotoCase = 26; continue; };
  1149. if (yych <= '*') { gotoCase = 28; continue; };
  1150. if (yych <= '+') { gotoCase = 29; continue; };
  1151. { gotoCase = 25; continue; };
  1152. } else {
  1153. if (yych <= '.') {
  1154. if (yych <= '-') { gotoCase = 30; continue; };
  1155. { gotoCase = 31; continue; };
  1156. } else {
  1157. if (yych <= '/') { gotoCase = 32; continue; };
  1158. if (yych <= '0') { gotoCase = 34; continue; };
  1159. { gotoCase = 36; continue; };
  1160. }
  1161. }
  1162. }
  1163. } else {
  1164. if (yych <= '\\') {
  1165. if (yych <= '>') {
  1166. if (yych <= ';') { gotoCase = 25; continue; };
  1167. if (yych <= '<') { gotoCase = 37; continue; };
  1168. if (yych <= '=') { gotoCase = 38; continue; };
  1169. { gotoCase = 39; continue; };
  1170. } else {
  1171. if (yych <= '@') {
  1172. if (yych <= '?') { gotoCase = 25; continue; };
  1173. } else {
  1174. if (yych <= 'Z') { gotoCase = 20; continue; };
  1175. if (yych <= '[') { gotoCase = 25; continue; };
  1176. { gotoCase = 40; continue; };
  1177. }
  1178. }
  1179. } else {
  1180. if (yych <= 'z') {
  1181. if (yych <= '^') {
  1182. if (yych <= ']') { gotoCase = 25; continue; };
  1183. { gotoCase = 41; continue; };
  1184. } else {
  1185. if (yych != '`') { gotoCase = 20; continue; };
  1186. }
  1187. } else {
  1188. if (yych <= '|') {
  1189. if (yych <= '{') { gotoCase = 25; continue; };
  1190. { gotoCase = 42; continue; };
  1191. } else {
  1192. if (yych <= '~') { gotoCase = 25; continue; };
  1193. if (yych >= 0x80) { gotoCase = 20; continue; };
  1194. }
  1195. }
  1196. }
  1197. }
  1198. case 15:
  1199. ++cursor;
  1200. case 16:
  1201. { this.tokenType = null; return cursor; }
  1202. case 17:
  1203. ++cursor;
  1204. if ((yych = this._charAt(cursor)) == '=') { gotoCase = 115; continue; };
  1205. case 18:
  1206. this.setLexCondition(this._lexConditions.NODIV);
  1207. {
  1208. var token = this._line.charAt(cursorOnEnter);
  1209. if (token === "{")
  1210. this.tokenType = "block-start";
  1211. else if (token === "}")
  1212. this.tokenType = "block-end";
  1213. else this.tokenType = null;
  1214. return cursor;
  1215. }
  1216. case 19:
  1217. yyaccept = 0;
  1218. yych = this._charAt(YYMARKER = ++cursor);
  1219. if (yych == '\n') { gotoCase = 16; continue; };
  1220. if (yych == '\r') { gotoCase = 16; continue; };
  1221. { gotoCase = 107; continue; };
  1222. case 20:
  1223. yyaccept = 1;
  1224. yych = this._charAt(YYMARKER = ++cursor);
  1225. { gotoCase = 50; continue; };
  1226. case 21:
  1227. {
  1228. var token = this._line.substring(cursorOnEnter, cursor);
  1229. if (WebInspector.SourceJavaScriptTokenizer.Keywords[token] === true && token !== "__proto__")
  1230. this.tokenType = "javascript-keyword";
  1231. else
  1232. this.tokenType = "javascript-ident";
  1233. return cursor;
  1234. }
  1235. case 22:
  1236. yych = this._charAt(++cursor);
  1237. if (yych == '=') { gotoCase = 43; continue; };
  1238. { gotoCase = 18; continue; };
  1239. case 23:
  1240. yych = this._charAt(++cursor);
  1241. if (yych == '&') { gotoCase = 43; continue; };
  1242. if (yych == '=') { gotoCase = 43; continue; };
  1243. { gotoCase = 18; continue; };
  1244. case 24:
  1245. yyaccept = 0;
  1246. yych = this._charAt(YYMARKER = ++cursor);
  1247. if (yych == '\n') { gotoCase = 16; continue; };
  1248. if (yych == '\r') { gotoCase = 16; continue; };
  1249. { gotoCase = 96; continue; };
  1250. case 25:
  1251. yych = this._charAt(++cursor);
  1252. { gotoCase = 18; continue; };
  1253. case 26:
  1254. ++cursor;
  1255. { this.tokenType = null; return cursor; }
  1256. case 28:
  1257. yych = this._charAt(++cursor);
  1258. if (yych == '=') { gotoCase = 43; continue; };
  1259. { gotoCase = 18; continue; };
  1260. case 29:
  1261. yych = this._charAt(++cursor);
  1262. if (yych == '+') { gotoCase = 43; continue; };
  1263. if (yych == '=') { gotoCase = 43; continue; };
  1264. { gotoCase = 18; continue; };
  1265. case 30:
  1266. yych = this._charAt(++cursor);
  1267. if (yych == '-') { gotoCase = 43; continue; };
  1268. if (yych == '=') { gotoCase = 43; continue; };
  1269. { gotoCase = 18; continue; };
  1270. case 31:
  1271. yych = this._charAt(++cursor);
  1272. if (yych <= '/') { gotoCase = 18; continue; };
  1273. if (yych <= '9') { gotoCase = 89; continue; };
  1274. { gotoCase = 18; continue; };
  1275. case 32:
  1276. yyaccept = 2;
  1277. yych = this._charAt(YYMARKER = ++cursor);
  1278. if (yych <= '.') {
  1279. if (yych == '*') { gotoCase = 78; continue; };
  1280. } else {
  1281. if (yych <= '/') { gotoCase = 80; continue; };
  1282. if (yych == '=') { gotoCase = 77; continue; };
  1283. }
  1284. case 33:
  1285. this.setLexCondition(this._lexConditions.NODIV);
  1286. { this.tokenType = null; return cursor; }
  1287. case 34:
  1288. yyaccept = 3;
  1289. yych = this._charAt(YYMARKER = ++cursor);
  1290. if (yych <= 'E') {
  1291. if (yych <= '/') {
  1292. if (yych == '.') { gotoCase = 63; continue; };
  1293. } else {
  1294. if (yych <= '7') { gotoCase = 72; continue; };
  1295. if (yych >= 'E') { gotoCase = 62; continue; };
  1296. }
  1297. } else {
  1298. if (yych <= 'd') {
  1299. if (yych == 'X') { gotoCase = 74; continue; };
  1300. } else {
  1301. if (yych <= 'e') { gotoCase = 62; continue; };
  1302. if (yych == 'x') { gotoCase = 74; continue; };
  1303. }
  1304. }
  1305. case 35:
  1306. { this.tokenType = "javascript-number"; return cursor; }
  1307. case 36:
  1308. yyaccept = 3;
  1309. yych = this._charAt(YYMARKER = ++cursor);
  1310. if (yych <= '9') {
  1311. if (yych == '.') { gotoCase = 63; continue; };
  1312. if (yych <= '/') { gotoCase = 35; continue; };
  1313. { gotoCase = 60; continue; };
  1314. } else {
  1315. if (yych <= 'E') {
  1316. if (yych <= 'D') { gotoCase = 35; continue; };
  1317. { gotoCase = 62; continue; };
  1318. } else {
  1319. if (yych == 'e') { gotoCase = 62; continue; };
  1320. { gotoCase = 35; continue; };
  1321. }
  1322. }
  1323. case 37:
  1324. yych = this._charAt(++cursor);
  1325. if (yych <= ';') { gotoCase = 18; continue; };
  1326. if (yych <= '<') { gotoCase = 59; continue; };
  1327. if (yych <= '=') { gotoCase = 43; continue; };
  1328. { gotoCase = 18; continue; };
  1329. case 38:
  1330. yych = this._charAt(++cursor);
  1331. if (yych == '=') { gotoCase = 58; continue; };
  1332. { gotoCase = 18; continue; };
  1333. case 39:
  1334. yych = this._charAt(++cursor);
  1335. if (yych <= '<') { gotoCase = 18; continue; };
  1336. if (yych <= '=') { gotoCase = 43; continue; };
  1337. if (yych <= '>') { gotoCase = 56; continue; };
  1338. { gotoCase = 18; continue; };
  1339. case 40:
  1340. yyaccept = 0;
  1341. yych = this._charAt(YYMARKER = ++cursor);
  1342. if (yych == 'u') { gotoCase = 44; continue; };
  1343. { gotoCase = 16; continue; };
  1344. case 41:
  1345. yych = this._charAt(++cursor);
  1346. if (yych == '=') { gotoCase = 43; continue; };
  1347. { gotoCase = 18; continue; };
  1348. case 42:
  1349. yych = this._charAt(++cursor);
  1350. if (yych == '=') { gotoCase = 43; continue; };
  1351. if (yych != '|') { gotoCase = 18; continue; };
  1352. case 43:
  1353. yych = this._charAt(++cursor);
  1354. { gotoCase = 18; continue; };
  1355. case 44:
  1356. yych = this._charAt(++cursor);
  1357. if (yych <= '@') {
  1358. if (yych <= '/') { gotoCase = 45; continue; };
  1359. if (yych <= '9') { gotoCase = 46; continue; };
  1360. } else {
  1361. if (yych <= 'F') { gotoCase = 46; continue; };
  1362. if (yych <= '`') { gotoCase = 45; continue; };
  1363. if (yych <= 'f') { gotoCase = 46; continue; };
  1364. }
  1365. case 45:
  1366. cursor = YYMARKER;
  1367. if (yyaccept <= 1) {
  1368. if (yyaccept <= 0) {
  1369. { gotoCase = 16; continue; };
  1370. } else {
  1371. { gotoCase = 21; continue; };
  1372. }
  1373. } else {
  1374. if (yyaccept <= 2) {
  1375. { gotoCase = 33; continue; };
  1376. } else {
  1377. { gotoCase = 35; continue; };
  1378. }
  1379. }
  1380. case 46:
  1381. yych = this._charAt(++cursor);
  1382. if (yych <= '@') {
  1383. if (yych <= '/') { gotoCase = 45; continue; };
  1384. if (yych >= ':') { gotoCase = 45; continue; };
  1385. } else {
  1386. if (yych <= 'F') { gotoCase = 47; continue; };
  1387. if (yych <= '`') { gotoCase = 45; continue; };
  1388. if (yych >= 'g') { gotoCase = 45; continue; };
  1389. }
  1390. case 47:
  1391. yych = this._charAt(++cursor);
  1392. if (yych <= '@') {
  1393. if (yych <= '/') { gotoCase = 45; continue; };
  1394. if (yych >= ':') { gotoCase = 45; continue; };
  1395. } else {
  1396. if (yych <= 'F') { gotoCase = 48; continue; };
  1397. if (yych <= '`') { gotoCase = 45; continue; };
  1398. if (yych >= 'g') { gotoCase = 45; continue; };
  1399. }
  1400. case 48:
  1401. yych = this._charAt(++cursor);
  1402. if (yych <= '@') {
  1403. if (yych <= '/') { gotoCase = 45; continue; };
  1404. if (yych >= ':') { gotoCase = 45; continue; };
  1405. } else {
  1406. if (yych <= 'F') { gotoCase = 49; continue; };
  1407. if (yych <= '`') { gotoCase = 45; continue; };
  1408. if (yych >= 'g') { gotoCase = 45; continue; };
  1409. }
  1410. case 49:
  1411. yyaccept = 1;
  1412. YYMARKER = ++cursor;
  1413. yych = this._charAt(cursor);
  1414. case 50:
  1415. if (yych <= '[') {
  1416. if (yych <= '/') {
  1417. if (yych == '$') { gotoCase = 49; continue; };
  1418. { gotoCase = 21; continue; };
  1419. } else {
  1420. if (yych <= '9') { gotoCase = 49; continue; };
  1421. if (yych <= '@') { gotoCase = 21; continue; };
  1422. if (yych <= 'Z') { gotoCase = 49; continue; };
  1423. { gotoCase = 21; continue; };
  1424. }
  1425. } else {
  1426. if (yych <= '_') {
  1427. if (yych <= '\\') { gotoCase = 51; continue; };
  1428. if (yych <= '^') { gotoCase = 21; continue; };
  1429. { gotoCase = 49; continue; };
  1430. } else {
  1431. if (yych <= '`') { gotoCase = 21; continue; };
  1432. if (yych <= 'z') { gotoCase = 49; continue; };
  1433. if (yych <= String.fromCharCode(0x7F)) { gotoCase = 21; continue; };
  1434. { gotoCase = 49; continue; };
  1435. }
  1436. }
  1437. case 51:
  1438. ++cursor;
  1439. yych = this._charAt(cursor);
  1440. if (yych != 'u') { gotoCase = 45; continue; };
  1441. ++cursor;
  1442. yych = this._charAt(cursor);
  1443. if (yych <= '@') {
  1444. if (yych <= '/') { gotoCase = 45; continue; };
  1445. if (yych >= ':') { gotoCase = 45; continue; };
  1446. } else {
  1447. if (yych <= 'F') { gotoCase = 53; continue; };
  1448. if (yych <= '`') { gotoCase = 45; continue; };
  1449. if (yych >= 'g') { gotoCase = 45; continue; };
  1450. }
  1451. case 53:
  1452. ++cursor;
  1453. yych = this._charAt(cursor);
  1454. if (yych <= '@') {
  1455. if (yych <= '/') { gotoCase = 45; continue; };
  1456. if (yych >= ':') { gotoCase = 45; continue; };
  1457. } else {
  1458. if (yych <= 'F') { gotoCase = 54; continue; };
  1459. if (yych <= '`') { gotoCase = 45; continue; };
  1460. if (yych >= 'g') { gotoCase = 45; continue; };
  1461. }
  1462. case 54:
  1463. ++cursor;
  1464. yych = this._charAt(cursor);
  1465. if (yych <= '@') {
  1466. if (yych <= '/') { gotoCase = 45; continue; };
  1467. if (yych >= ':') { gotoCase = 45; continue; };
  1468. } else {
  1469. if (yych <= 'F') { gotoCase = 55; continue; };
  1470. if (yych <= '`') { gotoCase = 45; continue; };
  1471. if (yych >= 'g') { gotoCase = 45; continue; };
  1472. }
  1473. case 55:
  1474. ++cursor;
  1475. yych = this._charAt(cursor);
  1476. if (yych <= '@') {
  1477. if (yych <= '/') { gotoCase = 45; continue; };
  1478. if (yych <= '9') { gotoCase = 49; continue; };
  1479. { gotoCase = 45; continue; };
  1480. } else {
  1481. if (yych <= 'F') { gotoCase = 49; continue; };
  1482. if (yych <= '`') { gotoCase = 45; continue; };
  1483. if (yych <= 'f') { gotoCase = 49; continue; };
  1484. { gotoCase = 45; continue; };
  1485. }
  1486. case 56:
  1487. yych = this._charAt(++cursor);
  1488. if (yych <= '<') { gotoCase = 18; continue; };
  1489. if (yych <= '=') { gotoCase = 43; continue; };
  1490. if (yych >= '?') { gotoCase = 18; continue; };
  1491. yych = this._charAt(++cursor);
  1492. if (yych == '=') { gotoCase = 43; continue; };
  1493. { gotoCase = 18; continue; };
  1494. case 58:
  1495. yych = this._charAt(++cursor);
  1496. if (yych == '=') { gotoCase = 43; continue; };
  1497. { gotoCase = 18; continue; };
  1498. case 59:
  1499. yych = this._charAt(++cursor);
  1500. if (yych == '=') { gotoCase = 43; continue; };
  1501. { gotoCase = 18; continue; };
  1502. case 60:
  1503. yyaccept = 3;
  1504. YYMARKER = ++cursor;
  1505. yych = this._charAt(cursor);
  1506. if (yych <= '9') {
  1507. if (yych == '.') { gotoCase = 63; continue; };
  1508. if (yych <= '/') { gotoCase = 35; continue; };
  1509. { gotoCase = 60; continue; };
  1510. } else {
  1511. if (yych <= 'E') {
  1512. if (yych <= 'D') { gotoCase = 35; continue; };
  1513. } else {
  1514. if (yych != 'e') { gotoCase = 35; continue; };
  1515. }
  1516. }
  1517. case 62:
  1518. yych = this._charAt(++cursor);
  1519. if (yych <= ',') {
  1520. if (yych == '+') { gotoCase = 69; continue; };
  1521. { gotoCase = 45; continue; };
  1522. } else {
  1523. if (yych <= '-') { gotoCase = 69; continue; };
  1524. if (yych <= '/') { gotoCase = 45; continue; };
  1525. if (yych <= '9') { gotoCase = 70; continue; };
  1526. { gotoCase = 45; continue; };
  1527. }
  1528. case 63:
  1529. yyaccept = 3;
  1530. YYMARKER = ++cursor;
  1531. yych = this._charAt(cursor);
  1532. if (yych <= 'D') {
  1533. if (yych <= '/') { gotoCase = 35; continue; };
  1534. if (yych <= '9') { gotoCase = 63; continue; };
  1535. { gotoCase = 35; continue; };
  1536. } else {
  1537. if (yych <= 'E') { gotoCase = 65; continue; };
  1538. if (yych != 'e') { gotoCase = 35; continue; };
  1539. }
  1540. case 65:
  1541. yych = this._charAt(++cursor);
  1542. if (yych <= ',') {
  1543. if (yych != '+') { gotoCase = 45; continue; };
  1544. } else {
  1545. if (yych <= '-') { gotoCase = 66; continue; };
  1546. if (yych <= '/') { gotoCase = 45; continue; };
  1547. if (yych <= '9') { gotoCase = 67; continue; };
  1548. { gotoCase = 45; continue; };
  1549. }
  1550. case 66:
  1551. yych = this._charAt(++cursor);
  1552. if (yych <= '/') { gotoCase = 45; continue; };
  1553. if (yych >= ':') { gotoCase = 45; continue; };
  1554. case 67:
  1555. ++cursor;
  1556. yych = this._charAt(cursor);
  1557. if (yych <= '/') { gotoCase = 35; continue; };
  1558. if (yych <= '9') { gotoCase = 67; continue; };
  1559. { gotoCase = 35; continue; };
  1560. case 69:
  1561. yych = this._charAt(++cursor);
  1562. if (yych <= '/') { gotoCase = 45; continue; };
  1563. if (yych >= ':') { gotoCase = 45; continue; };
  1564. case 70:
  1565. ++cursor;
  1566. yych = this._charAt(cursor);
  1567. if (yych <= '/') { gotoCase = 35; continue; };
  1568. if (yych <= '9') { gotoCase = 70; continue; };
  1569. { gotoCase = 35; continue; };
  1570. case 72:
  1571. ++cursor;
  1572. yych = this._charAt(cursor);
  1573. if (yych <= '/') { gotoCase = 35; continue; };
  1574. if (yych <= '7') { gotoCase = 72; continue; };
  1575. { gotoCase = 35; continue; };
  1576. case 74:
  1577. yych = this._charAt(++cursor);
  1578. if (yych <= '@') {
  1579. if (yych <= '/') { gotoCase = 45; continue; };
  1580. if (yych >= ':') { gotoCase = 45; continue; };
  1581. } else {
  1582. if (yych <= 'F') { gotoCase = 75; continue; };
  1583. if (yych <= '`') { gotoCase = 45; continue; };
  1584. if (yych >= 'g') { gotoCase = 45; continue; };
  1585. }
  1586. case 75:
  1587. ++cursor;
  1588. yych = this._charAt(cursor);
  1589. if (yych <= '@') {
  1590. if (yych <= '/') { gotoCase = 35; continue; };
  1591. if (yych <= '9') { gotoCase = 75; continue; };
  1592. { gotoCase = 35; continue; };
  1593. } else {
  1594. if (yych <= 'F') { gotoCase = 75; continue; };
  1595. if (yych <= '`') { gotoCase = 35; continue; };
  1596. if (yych <= 'f') { gotoCase = 75; continue; };
  1597. { gotoCase = 35; continue; };
  1598. }
  1599. case 77:
  1600. yych = this._charAt(++cursor);
  1601. { gotoCase = 33; continue; };
  1602. case 78:
  1603. ++cursor;
  1604. yych = this._charAt(cursor);
  1605. if (yych <= '\f') {
  1606. if (yych == '\n') { gotoCase = 85; continue; };
  1607. { gotoCase = 78; continue; };
  1608. } else {
  1609. if (yych <= '\r') { gotoCase = 85; continue; };
  1610. if (yych == '*') { gotoCase = 83; continue; };
  1611. { gotoCase = 78; continue; };
  1612. }
  1613. case 80:
  1614. ++cursor;
  1615. yych = this._charAt(cursor);
  1616. if (yych == '\n') { gotoCase = 82; continue; };
  1617. if (yych != '\r') { gotoCase = 80; continue; };
  1618. case 82:
  1619. { this.tokenType = "javascript-comment"; return cursor; }
  1620. case 83:
  1621. ++cursor;
  1622. yych = this._charAt(cursor);
  1623. if (yych == '*') { gotoCase = 83; continue; };
  1624. if (yych == '/') { gotoCase = 87; continue; };
  1625. { gotoCase = 78; continue; };
  1626. case 85:
  1627. ++cursor;
  1628. this.setLexCondition(this._lexConditions.COMMENT);
  1629. { this.tokenType = "javascript-comment"; return cursor; }
  1630. case 87:
  1631. ++cursor;
  1632. { this.tokenType = "javascript-comment"; return cursor; }
  1633. case 89:
  1634. yyaccept = 3;
  1635. YYMARKER = ++cursor;
  1636. yych = this._charAt(cursor);
  1637. if (yych <= 'D') {
  1638. if (yych <= '/') { gotoCase = 35; continue; };
  1639. if (yych <= '9') { gotoCase = 89; continue; };
  1640. { gotoCase = 35; continue; };
  1641. } else {
  1642. if (yych <= 'E') { gotoCase = 91; continue; };
  1643. if (yych != 'e') { gotoCase = 35; continue; };
  1644. }
  1645. case 91:
  1646. yych = this._charAt(++cursor);
  1647. if (yych <= ',') {
  1648. if (yych != '+') { gotoCase = 45; continue; };
  1649. } else {
  1650. if (yych <= '-') { gotoCase = 92; continue; };
  1651. if (yych <= '/') { gotoCase = 45; continue; };
  1652. if (yych <= '9') { gotoCase = 93; continue; };
  1653. { gotoCase = 45; continue; };
  1654. }
  1655. case 92:
  1656. yych = this._charAt(++cursor);
  1657. if (yych <= '/') { gotoCase = 45; continue; };
  1658. if (yych >= ':') { gotoCase = 45; continue; };
  1659. case 93:
  1660. ++cursor;
  1661. yych = this._charAt(cursor);
  1662. if (yych <= '/') { gotoCase = 35; continue; };
  1663. if (yych <= '9') { gotoCase = 93; continue; };
  1664. { gotoCase = 35; continue; };
  1665. case 95:
  1666. ++cursor;
  1667. yych = this._charAt(cursor);
  1668. case 96:
  1669. if (yych <= '\r') {
  1670. if (yych == '\n') { gotoCase = 45; continue; };
  1671. if (yych <= '\f') { gotoCase = 95; continue; };
  1672. { gotoCase = 45; continue; };
  1673. } else {
  1674. if (yych <= '\'') {
  1675. if (yych <= '&') { gotoCase = 95; continue; };
  1676. { gotoCase = 98; continue; };
  1677. } else {
  1678. if (yych != '\\') { gotoCase = 95; continue; };
  1679. }
  1680. }
  1681. ++cursor;
  1682. yych = this._charAt(cursor);
  1683. if (yych <= 'a') {
  1684. if (yych <= '!') {
  1685. if (yych <= '\n') {
  1686. if (yych <= '\t') { gotoCase = 45; continue; };
  1687. { gotoCase = 101; continue; };
  1688. } else {
  1689. if (yych == '\r') { gotoCase = 101; continue; };
  1690. { gotoCase = 45; continue; };
  1691. }
  1692. } else {
  1693. if (yych <= '\'') {
  1694. if (yych <= '"') { gotoCase = 95; continue; };
  1695. if (yych <= '&') { gotoCase = 45; continue; };
  1696. { gotoCase = 95; continue; };
  1697. } else {
  1698. if (yych == '\\') { gotoCase = 95; continue; };
  1699. { gotoCase = 45; continue; };
  1700. }
  1701. }
  1702. } else {
  1703. if (yych <= 'q') {
  1704. if (yych <= 'f') {
  1705. if (yych <= 'b') { gotoCase = 95; continue; };
  1706. if (yych <= 'e') { gotoCase = 45; continue; };
  1707. { gotoCase = 95; continue; };
  1708. } else {
  1709. if (yych == 'n') { gotoCase = 95; continue; };
  1710. { gotoCase = 45; continue; };
  1711. }
  1712. } else {
  1713. if (yych <= 't') {
  1714. if (yych == 's') { gotoCase = 45; continue; };
  1715. { gotoCase = 95; continue; };
  1716. } else {
  1717. if (yych <= 'u') { gotoCase = 100; continue; };
  1718. if (yych <= 'v') { gotoCase = 95; continue; };
  1719. { gotoCase = 45; continue; };
  1720. }
  1721. }
  1722. }
  1723. case 98:
  1724. ++cursor;
  1725. { this.tokenType = "javascript-string"; return cursor; }
  1726. case 100:
  1727. ++cursor;
  1728. yych = this._charAt(cursor);
  1729. if (yych <= '@') {
  1730. if (yych <= '/') { gotoCase = 45; continue; };
  1731. if (yych <= '9') { gotoCase = 103; continue; };
  1732. { gotoCase = 45; continue; };
  1733. } else {
  1734. if (yych <= 'F') { gotoCase = 103; continue; };
  1735. if (yych <= '`') { gotoCase = 45; continue; };
  1736. if (yych <= 'f') { gotoCase = 103; continue; };
  1737. { gotoCase = 45; continue; };
  1738. }
  1739. case 101:
  1740. ++cursor;
  1741. this.setLexCondition(this._lexConditions.SSTRING);
  1742. { this.tokenType = "javascript-string"; return cursor; }
  1743. case 103:
  1744. ++cursor;
  1745. yych = this._charAt(cursor);
  1746. if (yych <= '@') {
  1747. if (yych <= '/') { gotoCase = 45; continue; };
  1748. if (yych >= ':') { gotoCase = 45; continue; };
  1749. } else {
  1750. if (yych <= 'F') { gotoCase = 104; continue; };
  1751. if (yych <= '`') { gotoCase = 45; continue; };
  1752. if (yych >= 'g') { gotoCase = 45; continue; };
  1753. }
  1754. case 104:
  1755. ++cursor;
  1756. yych = this._charAt(cursor);
  1757. if (yych <= '@') {
  1758. if (yych <= '/') { gotoCase = 45; continue; };
  1759. if (yych >= ':') { gotoCase = 45; continue; };
  1760. } else {
  1761. if (yych <= 'F') { gotoCase = 105; continue; };
  1762. if (yych <= '`') { gotoCase = 45; continue; };
  1763. if (yych >= 'g') { gotoCase = 45; continue; };
  1764. }
  1765. case 105:
  1766. ++cursor;
  1767. yych = this._charAt(cursor);
  1768. if (yych <= '@') {
  1769. if (yych <= '/') { gotoCase = 45; continue; };
  1770. if (yych <= '9') { gotoCase = 95; continue; };
  1771. { gotoCase = 45; continue; };
  1772. } else {
  1773. if (yych <= 'F') { gotoCase = 95; continue; };
  1774. if (yych <= '`') { gotoCase = 45; continue; };
  1775. if (yych <= 'f') { gotoCase = 95; continue; };
  1776. { gotoCase = 45; continue; };
  1777. }
  1778. case 106:
  1779. ++cursor;
  1780. yych = this._charAt(cursor);
  1781. case 107:
  1782. if (yych <= '\r') {
  1783. if (yych == '\n') { gotoCase = 45; continue; };
  1784. if (yych <= '\f') { gotoCase = 106; continue; };
  1785. { gotoCase = 45; continue; };
  1786. } else {
  1787. if (yych <= '"') {
  1788. if (yych <= '!') { gotoCase = 106; continue; };
  1789. { gotoCase = 98; continue; };
  1790. } else {
  1791. if (yych != '\\') { gotoCase = 106; continue; };
  1792. }
  1793. }
  1794. ++cursor;
  1795. yych = this._charAt(cursor);
  1796. if (yych <= 'a') {
  1797. if (yych <= '!') {
  1798. if (yych <= '\n') {
  1799. if (yych <= '\t') { gotoCase = 45; continue; };
  1800. { gotoCase = 110; continue; };
  1801. } else {
  1802. if (yych == '\r') { gotoCase = 110; continue; };
  1803. { gotoCase = 45; continue; };
  1804. }
  1805. } else {
  1806. if (yych <= '\'') {
  1807. if (yych <= '"') { gotoCase = 106; continue; };
  1808. if (yych <= '&') { gotoCase = 45; continue; };
  1809. { gotoCase = 106; continue; };
  1810. } else {
  1811. if (yych == '\\') { gotoCase = 106; continue; };
  1812. { gotoCase = 45; continue; };
  1813. }
  1814. }
  1815. } else {
  1816. if (yych <= 'q') {
  1817. if (yych <= 'f') {
  1818. if (yych <= 'b') { gotoCase = 106; continue; };
  1819. if (yych <= 'e') { gotoCase = 45; continue; };
  1820. { gotoCase = 106; continue; };
  1821. } else {
  1822. if (yych == 'n') { gotoCase = 106; continue; };
  1823. { gotoCase = 45; continue; };
  1824. }
  1825. } else {
  1826. if (yych <= 't') {
  1827. if (yych == 's') { gotoCase = 45; continue; };
  1828. { gotoCase = 106; continue; };
  1829. } else {
  1830. if (yych <= 'u') { gotoCase = 109; continue; };
  1831. if (yych <= 'v') { gotoCase = 106; continue; };
  1832. { gotoCase = 45; continue; };
  1833. }
  1834. }
  1835. }
  1836. case 109:
  1837. ++cursor;
  1838. yych = this._charAt(cursor);
  1839. if (yych <= '@') {
  1840. if (yych <= '/') { gotoCase = 45; continue; };
  1841. if (yych <= '9') { gotoCase = 112; continue; };
  1842. { gotoCase = 45; continue; };
  1843. } else {
  1844. if (yych <= 'F') { gotoCase = 112; continue; };
  1845. if (yych <= '`') { gotoCase = 45; continue; };
  1846. if (yych <= 'f') { gotoCase = 112; continue; };
  1847. { gotoCase = 45; continue; };
  1848. }
  1849. case 110:
  1850. ++cursor;
  1851. this.setLexCondition(this._lexConditions.DSTRING);
  1852. { this.tokenType = "javascript-string"; return cursor; }
  1853. case 112:
  1854. ++cursor;
  1855. yych = this._charAt(cursor);
  1856. if (yych <= '@') {
  1857. if (yych <= '/') { gotoCase = 45; continue; };
  1858. if (yych >= ':') { gotoCase = 45; continue; };
  1859. } else {
  1860. if (yych <= 'F') { gotoCase = 113; continue; };
  1861. if (yych <= '`') { gotoCase = 45; continue; };
  1862. if (yych >= 'g') { gotoCase = 45; continue; };
  1863. }
  1864. case 113:
  1865. ++cursor;
  1866. yych = this._charAt(cursor);
  1867. if (yych <= '@') {
  1868. if (yych <= '/') { gotoCase = 45; continue; };
  1869. if (yych >= ':') { gotoCase = 45; continue; };
  1870. } else {
  1871. if (yych <= 'F') { gotoCase = 114; continue; };
  1872. if (yych <= '`') { gotoCase = 45; continue; };
  1873. if (yych >= 'g') { gotoCase = 45; continue; };
  1874. }
  1875. case 114:
  1876. ++cursor;
  1877. yych = this._charAt(cursor);
  1878. if (yych <= '@') {
  1879. if (yych <= '/') { gotoCase = 45; continue; };
  1880. if (yych <= '9') { gotoCase = 106; continue; };
  1881. { gotoCase = 45; continue; };
  1882. } else {
  1883. if (yych <= 'F') { gotoCase = 106; continue; };
  1884. if (yych <= '`') { gotoCase = 45; continue; };
  1885. if (yych <= 'f') { gotoCase = 106; continue; };
  1886. { gotoCase = 45; continue; };
  1887. }
  1888. case 115:
  1889. ++cursor;
  1890. if ((yych = this._charAt(cursor)) == '=') { gotoCase = 43; continue; };
  1891. { gotoCase = 18; continue; };
  1892.  
  1893. case this.case_DSTRING:
  1894. yych = this._charAt(cursor);
  1895. if (yych <= '\r') {
  1896. if (yych == '\n') { gotoCase = 120; continue; };
  1897. if (yych <= '\f') { gotoCase = 119; continue; };
  1898. { gotoCase = 120; continue; };
  1899. } else {
  1900. if (yych <= '"') {
  1901. if (yych <= '!') { gotoCase = 119; continue; };
  1902. { gotoCase = 122; continue; };
  1903. } else {
  1904. if (yych == '\\') { gotoCase = 124; continue; };
  1905. { gotoCase = 119; continue; };
  1906. }
  1907. }
  1908. case 118:
  1909. { this.tokenType = "javascript-string"; return cursor; }
  1910. case 119:
  1911. yyaccept = 0;
  1912. yych = this._charAt(YYMARKER = ++cursor);
  1913. { gotoCase = 126; continue; };
  1914. case 120:
  1915. ++cursor;
  1916. case 121:
  1917. { this.tokenType = null; return cursor; }
  1918. case 122:
  1919. ++cursor;
  1920. case 123:
  1921. this.setLexCondition(this._lexConditions.NODIV);
  1922. { this.tokenType = "javascript-string"; return cursor; }
  1923. case 124:
  1924. yyaccept = 1;
  1925. yych = this._charAt(YYMARKER = ++cursor);
  1926. if (yych <= 'e') {
  1927. if (yych <= '\'') {
  1928. if (yych == '"') { gotoCase = 125; continue; };
  1929. if (yych <= '&') { gotoCase = 121; continue; };
  1930. } else {
  1931. if (yych <= '\\') {
  1932. if (yych <= '[') { gotoCase = 121; continue; };
  1933. } else {
  1934. if (yych != 'b') { gotoCase = 121; continue; };
  1935. }
  1936. }
  1937. } else {
  1938. if (yych <= 'r') {
  1939. if (yych <= 'm') {
  1940. if (yych >= 'g') { gotoCase = 121; continue; };
  1941. } else {
  1942. if (yych <= 'n') { gotoCase = 125; continue; };
  1943. if (yych <= 'q') { gotoCase = 121; continue; };
  1944. }
  1945. } else {
  1946. if (yych <= 't') {
  1947. if (yych <= 's') { gotoCase = 121; continue; };
  1948. } else {
  1949. if (yych <= 'u') { gotoCase = 127; continue; };
  1950. if (yych >= 'w') { gotoCase = 121; continue; };
  1951. }
  1952. }
  1953. }
  1954. case 125:
  1955. yyaccept = 0;
  1956. YYMARKER = ++cursor;
  1957. yych = this._charAt(cursor);
  1958. case 126:
  1959. if (yych <= '\r') {
  1960. if (yych == '\n') { gotoCase = 118; continue; };
  1961. if (yych <= '\f') { gotoCase = 125; continue; };
  1962. { gotoCase = 118; continue; };
  1963. } else {
  1964. if (yych <= '"') {
  1965. if (yych <= '!') { gotoCase = 125; continue; };
  1966. { gotoCase = 133; continue; };
  1967. } else {
  1968. if (yych == '\\') { gotoCase = 132; continue; };
  1969. { gotoCase = 125; continue; };
  1970. }
  1971. }
  1972. case 127:
  1973. ++cursor;
  1974. yych = this._charAt(cursor);
  1975. if (yych <= '@') {
  1976. if (yych <= '/') { gotoCase = 128; continue; };
  1977. if (yych <= '9') { gotoCase = 129; continue; };
  1978. } else {
  1979. if (yych <= 'F') { gotoCase = 129; continue; };
  1980. if (yych <= '`') { gotoCase = 128; continue; };
  1981. if (yych <= 'f') { gotoCase = 129; continue; };
  1982. }
  1983. case 128:
  1984. cursor = YYMARKER;
  1985. if (yyaccept <= 0) {
  1986. { gotoCase = 118; continue; };
  1987. } else {
  1988. { gotoCase = 121; continue; };
  1989. }
  1990. case 129:
  1991. ++cursor;
  1992. yych = this._charAt(cursor);
  1993. if (yych <= '@') {
  1994. if (yych <= '/') { gotoCase = 128; continue; };
  1995. if (yych >= ':') { gotoCase = 128; continue; };
  1996. } else {
  1997. if (yych <= 'F') { gotoCase = 130; continue; };
  1998. if (yych <= '`') { gotoCase = 128; continue; };
  1999. if (yych >= 'g') { gotoCase = 128; continue; };
  2000. }
  2001. case 130:
  2002. ++cursor;
  2003. yych = this._charAt(cursor);
  2004. if (yych <= '@') {
  2005. if (yych <= '/') { gotoCase = 128; continue; };
  2006. if (yych >= ':') { gotoCase = 128; continue; };
  2007. } else {
  2008. if (yych <= 'F') { gotoCase = 131; continue; };
  2009. if (yych <= '`') { gotoCase = 128; continue; };
  2010. if (yych >= 'g') { gotoCase = 128; continue; };
  2011. }
  2012. case 131:
  2013. ++cursor;
  2014. yych = this._charAt(cursor);
  2015. if (yych <= '@') {
  2016. if (yych <= '/') { gotoCase = 128; continue; };
  2017. if (yych <= '9') { gotoCase = 125; continue; };
  2018. { gotoCase = 128; continue; };
  2019. } else {
  2020. if (yych <= 'F') { gotoCase = 125; continue; };
  2021. if (yych <= '`') { gotoCase = 128; continue; };
  2022. if (yych <= 'f') { gotoCase = 125; continue; };
  2023. { gotoCase = 128; continue; };
  2024. }
  2025. case 132:
  2026. ++cursor;
  2027. yych = this._charAt(cursor);
  2028. if (yych <= 'e') {
  2029. if (yych <= '\'') {
  2030. if (yych == '"') { gotoCase = 125; continue; };
  2031. if (yych <= '&') { gotoCase = 128; continue; };
  2032. { gotoCase = 125; continue; };
  2033. } else {
  2034. if (yych <= '\\') {
  2035. if (yych <= '[') { gotoCase = 128; continue; };
  2036. { gotoCase = 125; continue; };
  2037. } else {
  2038. if (yych == 'b') { gotoCase = 125; continue; };
  2039. { gotoCase = 128; continue; };
  2040. }
  2041. }
  2042. } else {
  2043. if (yych <= 'r') {
  2044. if (yych <= 'm') {
  2045. if (yych <= 'f') { gotoCase = 125; continue; };
  2046. { gotoCase = 128; continue; };
  2047. } else {
  2048. if (yych <= 'n') { gotoCase = 125; continue; };
  2049. if (yych <= 'q') { gotoCase = 128; continue; };
  2050. { gotoCase = 125; continue; };
  2051. }
  2052. } else {
  2053. if (yych <= 't') {
  2054. if (yych <= 's') { gotoCase = 128; continue; };
  2055. { gotoCase = 125; continue; };
  2056. } else {
  2057. if (yych <= 'u') { gotoCase = 127; continue; };
  2058. if (yych <= 'v') { gotoCase = 125; continue; };
  2059. { gotoCase = 128; continue; };
  2060. }
  2061. }
  2062. }
  2063. case 133:
  2064. ++cursor;
  2065. yych = this._charAt(cursor);
  2066. { gotoCase = 123; continue; };
  2067.  
  2068. case this.case_NODIV:
  2069. yych = this._charAt(cursor);
  2070. if (yych <= '9') {
  2071. if (yych <= '(') {
  2072. if (yych <= '#') {
  2073. if (yych <= ' ') { gotoCase = 136; continue; };
  2074. if (yych <= '!') { gotoCase = 138; continue; };
  2075. if (yych <= '"') { gotoCase = 140; continue; };
  2076. } else {
  2077. if (yych <= '%') {
  2078. if (yych <= '$') { gotoCase = 141; continue; };
  2079. { gotoCase = 143; continue; };
  2080. } else {
  2081. if (yych <= '&') { gotoCase = 144; continue; };
  2082. if (yych <= '\'') { gotoCase = 145; continue; };
  2083. { gotoCase = 146; continue; };
  2084. }
  2085. }
  2086. } else {
  2087. if (yych <= ',') {
  2088. if (yych <= ')') { gotoCase = 147; continue; };
  2089. if (yych <= '*') { gotoCase = 149; continue; };
  2090. if (yych <= '+') { gotoCase = 150; continue; };
  2091. { gotoCase = 146; continue; };
  2092. } else {
  2093. if (yych <= '.') {
  2094. if (yych <= '-') { gotoCase = 151; continue; };
  2095. { gotoCase = 152; continue; };
  2096. } else {
  2097. if (yych <= '/') { gotoCase = 153; continue; };
  2098. if (yych <= '0') { gotoCase = 154; continue; };
  2099. { gotoCase = 156; continue; };
  2100. }
  2101. }
  2102. }
  2103. } else {
  2104. if (yych <= '\\') {
  2105. if (yych <= '>') {
  2106. if (yych <= ';') { gotoCase = 146; continue; };
  2107. if (yych <= '<') { gotoCase = 157; continue; };
  2108. if (yych <= '=') { gotoCase = 158; continue; };
  2109. { gotoCase = 159; continue; };
  2110. } else {
  2111. if (yych <= '@') {
  2112. if (yych <= '?') { gotoCase = 146; continue; };
  2113. } else {
  2114. if (yych <= 'Z') { gotoCase = 141; continue; };
  2115. if (yych <= '[') { gotoCase = 146; continue; };
  2116. { gotoCase = 160; continue; };
  2117. }
  2118. }
  2119. } else {
  2120. if (yych <= 'z') {
  2121. if (yych <= '^') {
  2122. if (yych <= ']') { gotoCase = 146; continue; };
  2123. { gotoCase = 161; continue; };
  2124. } else {
  2125. if (yych != '`') { gotoCase = 141; continue; };
  2126. }
  2127. } else {
  2128. if (yych <= '|') {
  2129. if (yych <= '{') { gotoCase = 146; continue; };
  2130. { gotoCase = 162; continue; };
  2131. } else {
  2132. if (yych <= '~') { gotoCase = 146; continue; };
  2133. if (yych >= 0x80) { gotoCase = 141; continue; };
  2134. }
  2135. }
  2136. }
  2137. }
  2138. case 136:
  2139. ++cursor;
  2140. case 137:
  2141. { this.tokenType = null; return cursor; }
  2142. case 138:
  2143. ++cursor;
  2144. if ((yych = this._charAt(cursor)) == '=') { gotoCase = 260; continue; };
  2145. case 139:
  2146. {
  2147. var token = this._line.charAt(cursorOnEnter);
  2148. if (token === "{")
  2149. this.tokenType = "block-start";
  2150. else if (token === "}")
  2151. this.tokenType = "block-end";
  2152. else this.tokenType = null;
  2153. return cursor;
  2154. }
  2155. case 140:
  2156. yyaccept = 0;
  2157. yych = this._charAt(YYMARKER = ++cursor);
  2158. if (yych == '\n') { gotoCase = 137; continue; };
  2159. if (yych == '\r') { gotoCase = 137; continue; };
  2160. { gotoCase = 252; continue; };
  2161. case 141:
  2162. yyaccept = 1;
  2163. yych = this._charAt(YYMARKER = ++cursor);
  2164. { gotoCase = 170; continue; };
  2165. case 142:
  2166. this.setLexCondition(this._lexConditions.DIV);
  2167. {
  2168. var token = this._line.substring(cursorOnEnter, cursor);
  2169. if (WebInspector.SourceJavaScriptTokenizer.Keywords[token] === true && token !== "__proto__")
  2170. this.tokenType = "javascript-keyword";
  2171. else
  2172. this.tokenType = "javascript-ident";
  2173. return cursor;
  2174. }
  2175. case 143:
  2176. yych = this._charAt(++cursor);
  2177. if (yych == '=') { gotoCase = 163; continue; };
  2178. { gotoCase = 139; continue; };
  2179. case 144:
  2180. yych = this._charAt(++cursor);
  2181. if (yych == '&') { gotoCase = 163; continue; };
  2182. if (yych == '=') { gotoCase = 163; continue; };
  2183. { gotoCase = 139; continue; };
  2184. case 145:
  2185. yyaccept = 0;
  2186. yych = this._charAt(YYMARKER = ++cursor);
  2187. if (yych == '\n') { gotoCase = 137; continue; };
  2188. if (yych == '\r') { gotoCase = 137; continue; };
  2189. { gotoCase = 241; continue; };
  2190. case 146:
  2191. yych = this._charAt(++cursor);
  2192. { gotoCase = 139; continue; };
  2193. case 147:
  2194. ++cursor;
  2195. this.setLexCondition(this._lexConditions.DIV);
  2196. { this.tokenType = null; return cursor; }
  2197. case 149:
  2198. yych = this._charAt(++cursor);
  2199. if (yych == '=') { gotoCase = 163; continue; };
  2200. { gotoCase = 139; continue; };
  2201. case 150:
  2202. yych = this._charAt(++cursor);
  2203. if (yych == '+') { gotoCase = 163; continue; };
  2204. if (yych == '=') { gotoCase = 163; continue; };
  2205. { gotoCase = 139; continue; };
  2206. case 151:
  2207. yych = this._charAt(++cursor);
  2208. if (yych == '-') { gotoCase = 163; continue; };
  2209. if (yych == '=') { gotoCase = 163; continue; };
  2210. { gotoCase = 139; continue; };
  2211. case 152:
  2212. yych = this._charAt(++cursor);
  2213. if (yych <= '/') { gotoCase = 139; continue; };
  2214. if (yych <= '9') { gotoCase = 234; continue; };
  2215. { gotoCase = 139; continue; };
  2216. case 153:
  2217. yyaccept = 0;
  2218. yych = this._charAt(YYMARKER = ++cursor);
  2219. if (yych <= '*') {
  2220. if (yych <= '\f') {
  2221. if (yych == '\n') { gotoCase = 137; continue; };
  2222. { gotoCase = 197; continue; };
  2223. } else {
  2224. if (yych <= '\r') { gotoCase = 137; continue; };
  2225. if (yych <= ')') { gotoCase = 197; continue; };
  2226. { gotoCase = 202; continue; };
  2227. }
  2228. } else {
  2229. if (yych <= 'Z') {
  2230. if (yych == '/') { gotoCase = 204; continue; };
  2231. { gotoCase = 197; continue; };
  2232. } else {
  2233. if (yych <= '[') { gotoCase = 200; continue; };
  2234. if (yych <= '\\') { gotoCase = 199; continue; };
  2235. if (yych <= ']') { gotoCase = 137; continue; };
  2236. { gotoCase = 197; continue; };
  2237. }
  2238. }
  2239. case 154:
  2240. yyaccept = 2;
  2241. yych = this._charAt(YYMARKER = ++cursor);
  2242. if (yych <= 'E') {
  2243. if (yych <= '/') {
  2244. if (yych == '.') { gotoCase = 183; continue; };
  2245. } else {
  2246. if (yych <= '7') { gotoCase = 192; continue; };
  2247. if (yych >= 'E') { gotoCase = 182; continue; };
  2248. }
  2249. } else {
  2250. if (yych <= 'd') {
  2251. if (yych == 'X') { gotoCase = 194; continue; };
  2252. } else {
  2253. if (yych <= 'e') { gotoCase = 182; continue; };
  2254. if (yych == 'x') { gotoCase = 194; continue; };
  2255. }
  2256. }
  2257. case 155:
  2258. this.setLexCondition(this._lexConditions.DIV);
  2259. { this.tokenType = "javascript-number"; return cursor; }
  2260. case 156:
  2261. yyaccept = 2;
  2262. yych = this._charAt(YYMARKER = ++cursor);
  2263. if (yych <= '9') {
  2264. if (yych == '.') { gotoCase = 183; continue; };
  2265. if (yych <= '/') { gotoCase = 155; continue; };
  2266. { gotoCase = 180; continue; };
  2267. } else {
  2268. if (yych <= 'E') {
  2269. if (yych <= 'D') { gotoCase = 155; continue; };
  2270. { gotoCase = 182; continue; };
  2271. } else {
  2272. if (yych == 'e') { gotoCase = 182; continue; };
  2273. { gotoCase = 155; continue; };
  2274. }
  2275. }
  2276. case 157:
  2277. yych = this._charAt(++cursor);
  2278. if (yych <= ';') { gotoCase = 139; continue; };
  2279. if (yych <= '<') { gotoCase = 179; continue; };
  2280. if (yych <= '=') { gotoCase = 163; continue; };
  2281. { gotoCase = 139; continue; };
  2282. case 158:
  2283. yych = this._charAt(++cursor);
  2284. if (yych == '=') { gotoCase = 178; continue; };
  2285. { gotoCase = 139; continue; };
  2286. case 159:
  2287. yych = this._charAt(++cursor);
  2288. if (yych <= '<') { gotoCase = 139; continue; };
  2289. if (yych <= '=') { gotoCase = 163; continue; };
  2290. if (yych <= '>') { gotoCase = 176; continue; };
  2291. { gotoCase = 139; continue; };
  2292. case 160:
  2293. yyaccept = 0;
  2294. yych = this._charAt(YYMARKER = ++cursor);
  2295. if (yych == 'u') { gotoCase = 164; continue; };
  2296. { gotoCase = 137; continue; };
  2297. case 161:
  2298. yych = this._charAt(++cursor);
  2299. if (yych == '=') { gotoCase = 163; continue; };
  2300. { gotoCase = 139; continue; };
  2301. case 162:
  2302. yych = this._charAt(++cursor);
  2303. if (yych == '=') { gotoCase = 163; continue; };
  2304. if (yych != '|') { gotoCase = 139; continue; };
  2305. case 163:
  2306. yych = this._charAt(++cursor);
  2307. { gotoCase = 139; continue; };
  2308. case 164:
  2309. yych = this._charAt(++cursor);
  2310. if (yych <= '@') {
  2311. if (yych <= '/') { gotoCase = 165; continue; };
  2312. if (yych <= '9') { gotoCase = 166; continue; };
  2313. } else {
  2314. if (yych <= 'F') { gotoCase = 166; continue; };
  2315. if (yych <= '`') { gotoCase = 165; continue; };
  2316. if (yych <= 'f') { gotoCase = 166; continue; };
  2317. }
  2318. case 165:
  2319. cursor = YYMARKER;
  2320. if (yyaccept <= 1) {
  2321. if (yyaccept <= 0) {
  2322. { gotoCase = 137; continue; };
  2323. } else {
  2324. { gotoCase = 142; continue; };
  2325. }
  2326. } else {
  2327. if (yyaccept <= 2) {
  2328. { gotoCase = 155; continue; };
  2329. } else {
  2330. { gotoCase = 217; continue; };
  2331. }
  2332. }
  2333. case 166:
  2334. yych = this._charAt(++cursor);
  2335. if (yych <= '@') {
  2336. if (yych <= '/') { gotoCase = 165; continue; };
  2337. if (yych >= ':') { gotoCase = 165; continue; };
  2338. } else {
  2339. if (yych <= 'F') { gotoCase = 167; continue; };
  2340. if (yych <= '`') { gotoCase = 165; continue; };
  2341. if (yych >= 'g') { gotoCase = 165; continue; };
  2342. }
  2343. case 167:
  2344. yych = this._charAt(++cursor);
  2345. if (yych <= '@') {
  2346. if (yych <= '/') { gotoCase = 165; continue; };
  2347. if (yych >= ':') { gotoCase = 165; continue; };
  2348. } else {
  2349. if (yych <= 'F') { gotoCase = 168; continue; };
  2350. if (yych <= '`') { gotoCase = 165; continue; };
  2351. if (yych >= 'g') { gotoCase = 165; continue; };
  2352. }
  2353. case 168:
  2354. yych = this._charAt(++cursor);
  2355. if (yych <= '@') {
  2356. if (yych <= '/') { gotoCase = 165; continue; };
  2357. if (yych >= ':') { gotoCase = 165; continue; };
  2358. } else {
  2359. if (yych <= 'F') { gotoCase = 169; continue; };
  2360. if (yych <= '`') { gotoCase = 165; continue; };
  2361. if (yych >= 'g') { gotoCase = 165; continue; };
  2362. }
  2363. case 169:
  2364. yyaccept = 1;
  2365. YYMARKER = ++cursor;
  2366. yych = this._charAt(cursor);
  2367. case 170:
  2368. if (yych <= '[') {
  2369. if (yych <= '/') {
  2370. if (yych == '$') { gotoCase = 169; continue; };
  2371. { gotoCase = 142; continue; };
  2372. } else {
  2373. if (yych <= '9') { gotoCase = 169; continue; };
  2374. if (yych <= '@') { gotoCase = 142; continue; };
  2375. if (yych <= 'Z') { gotoCase = 169; continue; };
  2376. { gotoCase = 142; continue; };
  2377. }
  2378. } else {
  2379. if (yych <= '_') {
  2380. if (yych <= '\\') { gotoCase = 171; continue; };
  2381. if (yych <= '^') { gotoCase = 142; continue; };
  2382. { gotoCase = 169; continue; };
  2383. } else {
  2384. if (yych <= '`') { gotoCase = 142; continue; };
  2385. if (yych <= 'z') { gotoCase = 169; continue; };
  2386. if (yych <= String.fromCharCode(0x7F)) { gotoCase = 142; continue; };
  2387. { gotoCase = 169; continue; };
  2388. }
  2389. }
  2390. case 171:
  2391. ++cursor;
  2392. yych = this._charAt(cursor);
  2393. if (yych != 'u') { gotoCase = 165; continue; };
  2394. ++cursor;
  2395. yych = this._charAt(cursor);
  2396. if (yych <= '@') {
  2397. if (yych <= '/') { gotoCase = 165; continue; };
  2398. if (yych >= ':') { gotoCase = 165; continue; };
  2399. } else {
  2400. if (yych <= 'F') { gotoCase = 173; continue; };
  2401. if (yych <= '`') { gotoCase = 165; continue; };
  2402. if (yych >= 'g') { gotoCase = 165; continue; };
  2403. }
  2404. case 173:
  2405. ++cursor;
  2406. yych = this._charAt(cursor);
  2407. if (yych <= '@') {
  2408. if (yych <= '/') { gotoCase = 165; continue; };
  2409. if (yych >= ':') { gotoCase = 165; continue; };
  2410. } else {
  2411. if (yych <= 'F') { gotoCase = 174; continue; };
  2412. if (yych <= '`') { gotoCase = 165; continue; };
  2413. if (yych >= 'g') { gotoCase = 165; continue; };
  2414. }
  2415. case 174:
  2416. ++cursor;
  2417. yych = this._charAt(cursor);
  2418. if (yych <= '@') {
  2419. if (yych <= '/') { gotoCase = 165; continue; };
  2420. if (yych >= ':') { gotoCase = 165; continue; };
  2421. } else {
  2422. if (yych <= 'F') { gotoCase = 175; continue; };
  2423. if (yych <= '`') { gotoCase = 165; continue; };
  2424. if (yych >= 'g') { gotoCase = 165; continue; };
  2425. }
  2426. case 175:
  2427. ++cursor;
  2428. yych = this._charAt(cursor);
  2429. if (yych <= '@') {
  2430. if (yych <= '/') { gotoCase = 165; continue; };
  2431. if (yych <= '9') { gotoCase = 169; continue; };
  2432. { gotoCase = 165; continue; };
  2433. } else {
  2434. if (yych <= 'F') { gotoCase = 169; continue; };
  2435. if (yych <= '`') { gotoCase = 165; continue; };
  2436. if (yych <= 'f') { gotoCase = 169; continue; };
  2437. { gotoCase = 165; continue; };
  2438. }
  2439. case 176:
  2440. yych = this._charAt(++cursor);
  2441. if (yych <= '<') { gotoCase = 139; continue; };
  2442. if (yych <= '=') { gotoCase = 163; continue; };
  2443. if (yych >= '?') { gotoCase = 139; continue; };
  2444. yych = this._charAt(++cursor);
  2445. if (yych == '=') { gotoCase = 163; continue; };
  2446. { gotoCase = 139; continue; };
  2447. case 178:
  2448. yych = this._charAt(++cursor);
  2449. if (yych == '=') { gotoCase = 163; continue; };
  2450. { gotoCase = 139; continue; };
  2451. case 179:
  2452. yych = this._charAt(++cursor);
  2453. if (yych == '=') { gotoCase = 163; continue; };
  2454. { gotoCase = 139; continue; };
  2455. case 180:
  2456. yyaccept = 2;
  2457. YYMARKER = ++cursor;
  2458. yych = this._charAt(cursor);
  2459. if (yych <= '9') {
  2460. if (yych == '.') { gotoCase = 183; continue; };
  2461. if (yych <= '/') { gotoCase = 155; continue; };
  2462. { gotoCase = 180; continue; };
  2463. } else {
  2464. if (yych <= 'E') {
  2465. if (yych <= 'D') { gotoCase = 155; continue; };
  2466. } else {
  2467. if (yych != 'e') { gotoCase = 155; continue; };
  2468. }
  2469. }
  2470. case 182:
  2471. yych = this._charAt(++cursor);
  2472. if (yych <= ',') {
  2473. if (yych == '+') { gotoCase = 189; continue; };
  2474. { gotoCase = 165; continue; };
  2475. } else {
  2476. if (yych <= '-') { gotoCase = 189; continue; };
  2477. if (yych <= '/') { gotoCase = 165; continue; };
  2478. if (yych <= '9') { gotoCase = 190; continue; };
  2479. { gotoCase = 165; continue; };
  2480. }
  2481. case 183:
  2482. yyaccept = 2;
  2483. YYMARKER = ++cursor;
  2484. yych = this._charAt(cursor);
  2485. if (yych <= 'D') {
  2486. if (yych <= '/') { gotoCase = 155; continue; };
  2487. if (yych <= '9') { gotoCase = 183; continue; };
  2488. { gotoCase = 155; continue; };
  2489. } else {
  2490. if (yych <= 'E') { gotoCase = 185; continue; };
  2491. if (yych != 'e') { gotoCase = 155; continue; };
  2492. }
  2493. case 185:
  2494. yych = this._charAt(++cursor);
  2495. if (yych <= ',') {
  2496. if (yych != '+') { gotoCase = 165; continue; };
  2497. } else {
  2498. if (yych <= '-') { gotoCase = 186; continue; };
  2499. if (yych <= '/') { gotoCase = 165; continue; };
  2500. if (yych <= '9') { gotoCase = 187; continue; };
  2501. { gotoCase = 165; continue; };
  2502. }
  2503. case 186:
  2504. yych = this._charAt(++cursor);
  2505. if (yych <= '/') { gotoCase = 165; continue; };
  2506. if (yych >= ':') { gotoCase = 165; continue; };
  2507. case 187:
  2508. ++cursor;
  2509. yych = this._charAt(cursor);
  2510. if (yych <= '/') { gotoCase = 155; continue; };
  2511. if (yych <= '9') { gotoCase = 187; continue; };
  2512. { gotoCase = 155; continue; };
  2513. case 189:
  2514. yych = this._charAt(++cursor);
  2515. if (yych <= '/') { gotoCase = 165; continue; };
  2516. if (yych >= ':') { gotoCase = 165; continue; };
  2517. case 190:
  2518. ++cursor;
  2519. yych = this._charAt(cursor);
  2520. if (yych <= '/') { gotoCase = 155; continue; };
  2521. if (yych <= '9') { gotoCase = 190; continue; };
  2522. { gotoCase = 155; continue; };
  2523. case 192:
  2524. ++cursor;
  2525. yych = this._charAt(cursor);
  2526. if (yych <= '/') { gotoCase = 155; continue; };
  2527. if (yych <= '7') { gotoCase = 192; continue; };
  2528. { gotoCase = 155; continue; };
  2529. case 194:
  2530. yych = this._charAt(++cursor);
  2531. if (yych <= '@') {
  2532. if (yych <= '/') { gotoCase = 165; continue; };
  2533. if (yych >= ':') { gotoCase = 165; continue; };
  2534. } else {
  2535. if (yych <= 'F') { gotoCase = 195; continue; };
  2536. if (yych <= '`') { gotoCase = 165; continue; };
  2537. if (yych >= 'g') { gotoCase = 165; continue; };
  2538. }
  2539. case 195:
  2540. ++cursor;
  2541. yych = this._charAt(cursor);
  2542. if (yych <= '@') {
  2543. if (yych <= '/') { gotoCase = 155; continue; };
  2544. if (yych <= '9') { gotoCase = 195; continue; };
  2545. { gotoCase = 155; continue; };
  2546. } else {
  2547. if (yych <= 'F') { gotoCase = 195; continue; };
  2548. if (yych <= '`') { gotoCase = 155; continue; };
  2549. if (yych <= 'f') { gotoCase = 195; continue; };
  2550. { gotoCase = 155; continue; };
  2551. }
  2552. case 197:
  2553. ++cursor;
  2554. yych = this._charAt(cursor);
  2555. if (yych <= '.') {
  2556. if (yych <= '\n') {
  2557. if (yych <= '\t') { gotoCase = 197; continue; };
  2558. { gotoCase = 165; continue; };
  2559. } else {
  2560. if (yych == '\r') { gotoCase = 165; continue; };
  2561. { gotoCase = 197; continue; };
  2562. }
  2563. } else {
  2564. if (yych <= '[') {
  2565. if (yych <= '/') { gotoCase = 220; continue; };
  2566. if (yych <= 'Z') { gotoCase = 197; continue; };
  2567. { gotoCase = 228; continue; };
  2568. } else {
  2569. if (yych <= '\\') { gotoCase = 227; continue; };
  2570. if (yych <= ']') { gotoCase = 165; continue; };
  2571. { gotoCase = 197; continue; };
  2572. }
  2573. }
  2574. case 199:
  2575. yych = this._charAt(++cursor);
  2576. if (yych == '\n') { gotoCase = 165; continue; };
  2577. if (yych == '\r') { gotoCase = 165; continue; };
  2578. { gotoCase = 197; continue; };
  2579. case 200:
  2580. ++cursor;
  2581. yych = this._charAt(cursor);
  2582. if (yych <= '*') {
  2583. if (yych <= '\f') {
  2584. if (yych == '\n') { gotoCase = 165; continue; };
  2585. { gotoCase = 200; continue; };
  2586. } else {
  2587. if (yych <= '\r') { gotoCase = 165; continue; };
  2588. if (yych <= ')') { gotoCase = 200; continue; };
  2589. { gotoCase = 165; continue; };
  2590. }
  2591. } else {
  2592. if (yych <= '[') {
  2593. if (yych == '/') { gotoCase = 165; continue; };
  2594. { gotoCase = 200; continue; };
  2595. } else {
  2596. if (yych <= '\\') { gotoCase = 215; continue; };
  2597. if (yych <= ']') { gotoCase = 213; continue; };
  2598. { gotoCase = 200; continue; };
  2599. }
  2600. }
  2601. case 202:
  2602. ++cursor;
  2603. yych = this._charAt(cursor);
  2604. if (yych <= '\f') {
  2605. if (yych == '\n') { gotoCase = 209; continue; };
  2606. { gotoCase = 202; continue; };
  2607. } else {
  2608. if (yych <= '\r') { gotoCase = 209; continue; };
  2609. if (yych == '*') { gotoCase = 207; continue; };
  2610. { gotoCase = 202; continue; };
  2611. }
  2612. case 204:
  2613. ++cursor;
  2614. yych = this._charAt(cursor);
  2615. if (yych == '\n') { gotoCase = 206; continue; };
  2616. if (yych != '\r') { gotoCase = 204; continue; };
  2617. case 206:
  2618. { this.tokenType = "javascript-comment"; return cursor; }
  2619. case 207:
  2620. ++cursor;
  2621. yych = this._charAt(cursor);
  2622. if (yych == '*') { gotoCase = 207; continue; };
  2623. if (yych == '/') { gotoCase = 211; continue; };
  2624. { gotoCase = 202; continue; };
  2625. case 209:
  2626. ++cursor;
  2627. this.setLexCondition(this._lexConditions.COMMENT);
  2628. { this.tokenType = "javascript-comment"; return cursor; }
  2629. case 211:
  2630. ++cursor;
  2631. { this.tokenType = "javascript-comment"; return cursor; }
  2632. case 213:
  2633. ++cursor;
  2634. yych = this._charAt(cursor);
  2635. if (yych <= '*') {
  2636. if (yych <= '\f') {
  2637. if (yych == '\n') { gotoCase = 165; continue; };
  2638. { gotoCase = 213; continue; };
  2639. } else {
  2640. if (yych <= '\r') { gotoCase = 165; continue; };
  2641. if (yych <= ')') { gotoCase = 213; continue; };
  2642. { gotoCase = 197; continue; };
  2643. }
  2644. } else {
  2645. if (yych <= 'Z') {
  2646. if (yych == '/') { gotoCase = 220; continue; };
  2647. { gotoCase = 213; continue; };
  2648. } else {
  2649. if (yych <= '[') { gotoCase = 218; continue; };
  2650. if (yych <= '\\') { gotoCase = 216; continue; };
  2651. { gotoCase = 213; continue; };
  2652. }
  2653. }
  2654. case 215:
  2655. ++cursor;
  2656. yych = this._charAt(cursor);
  2657. if (yych == '\n') { gotoCase = 165; continue; };
  2658. if (yych == '\r') { gotoCase = 165; continue; };
  2659. { gotoCase = 200; continue; };
  2660. case 216:
  2661. yyaccept = 3;
  2662. YYMARKER = ++cursor;
  2663. yych = this._charAt(cursor);
  2664. if (yych == '\n') { gotoCase = 217; continue; };
  2665. if (yych != '\r') { gotoCase = 213; continue; };
  2666. case 217:
  2667. this.setLexCondition(this._lexConditions.REGEX);
  2668. { this.tokenType = "javascript-regexp"; return cursor; }
  2669. case 218:
  2670. ++cursor;
  2671. yych = this._charAt(cursor);
  2672. if (yych <= '*') {
  2673. if (yych <= '\f') {
  2674. if (yych == '\n') { gotoCase = 165; continue; };
  2675. { gotoCase = 218; continue; };
  2676. } else {
  2677. if (yych <= '\r') { gotoCase = 165; continue; };
  2678. if (yych <= ')') { gotoCase = 218; continue; };
  2679. { gotoCase = 165; continue; };
  2680. }
  2681. } else {
  2682. if (yych <= '[') {
  2683. if (yych == '/') { gotoCase = 165; continue; };
  2684. { gotoCase = 218; continue; };
  2685. } else {
  2686. if (yych <= '\\') { gotoCase = 225; continue; };
  2687. if (yych <= ']') { gotoCase = 223; continue; };
  2688. { gotoCase = 218; continue; };
  2689. }
  2690. }
  2691. case 220:
  2692. ++cursor;
  2693. yych = this._charAt(cursor);
  2694. if (yych <= 'h') {
  2695. if (yych == 'g') { gotoCase = 220; continue; };
  2696. } else {
  2697. if (yych <= 'i') { gotoCase = 220; continue; };
  2698. if (yych == 'm') { gotoCase = 220; continue; };
  2699. }
  2700. { this.tokenType = "javascript-regexp"; return cursor; }
  2701. case 223:
  2702. ++cursor;
  2703. yych = this._charAt(cursor);
  2704. if (yych <= '*') {
  2705. if (yych <= '\f') {
  2706. if (yych == '\n') { gotoCase = 165; continue; };
  2707. { gotoCase = 223; continue; };
  2708. } else {
  2709. if (yych <= '\r') { gotoCase = 165; continue; };
  2710. if (yych <= ')') { gotoCase = 223; continue; };
  2711. { gotoCase = 197; continue; };
  2712. }
  2713. } else {
  2714. if (yych <= 'Z') {
  2715. if (yych == '/') { gotoCase = 220; continue; };
  2716. { gotoCase = 223; continue; };
  2717. } else {
  2718. if (yych <= '[') { gotoCase = 218; continue; };
  2719. if (yych <= '\\') { gotoCase = 226; continue; };
  2720. { gotoCase = 223; continue; };
  2721. }
  2722. }
  2723. case 225:
  2724. ++cursor;
  2725. yych = this._charAt(cursor);
  2726. if (yych == '\n') { gotoCase = 165; continue; };
  2727. if (yych == '\r') { gotoCase = 165; continue; };
  2728. { gotoCase = 218; continue; };
  2729. case 226:
  2730. yyaccept = 3;
  2731. YYMARKER = ++cursor;
  2732. yych = this._charAt(cursor);
  2733. if (yych == '\n') { gotoCase = 217; continue; };
  2734. if (yych == '\r') { gotoCase = 217; continue; };
  2735. { gotoCase = 223; continue; };
  2736. case 227:
  2737. yyaccept = 3;
  2738. YYMARKER = ++cursor;
  2739. yych = this._charAt(cursor);
  2740. if (yych == '\n') { gotoCase = 217; continue; };
  2741. if (yych == '\r') { gotoCase = 217; continue; };
  2742. { gotoCase = 197; continue; };
  2743. case 228:
  2744. ++cursor;
  2745. yych = this._charAt(cursor);
  2746. if (yych <= '*') {
  2747. if (yych <= '\f') {
  2748. if (yych == '\n') { gotoCase = 165; continue; };
  2749. { gotoCase = 228; continue; };
  2750. } else {
  2751. if (yych <= '\r') { gotoCase = 165; continue; };
  2752. if (yych <= ')') { gotoCase = 228; continue; };
  2753. { gotoCase = 165; continue; };
  2754. }
  2755. } else {
  2756. if (yych <= '[') {
  2757. if (yych == '/') { gotoCase = 165; continue; };
  2758. { gotoCase = 228; continue; };
  2759. } else {
  2760. if (yych <= '\\') { gotoCase = 232; continue; };
  2761. if (yych >= '^') { gotoCase = 228; continue; };
  2762. }
  2763. }
  2764. case 230:
  2765. ++cursor;
  2766. yych = this._charAt(cursor);
  2767. if (yych <= '*') {
  2768. if (yych <= '\f') {
  2769. if (yych == '\n') { gotoCase = 165; continue; };
  2770. { gotoCase = 230; continue; };
  2771. } else {
  2772. if (yych <= '\r') { gotoCase = 165; continue; };
  2773. if (yych <= ')') { gotoCase = 230; continue; };
  2774. { gotoCase = 197; continue; };
  2775. }
  2776. } else {
  2777. if (yych <= 'Z') {
  2778. if (yych == '/') { gotoCase = 220; continue; };
  2779. { gotoCase = 230; continue; };
  2780. } else {
  2781. if (yych <= '[') { gotoCase = 228; continue; };
  2782. if (yych <= '\\') { gotoCase = 233; continue; };
  2783. { gotoCase = 230; continue; };
  2784. }
  2785. }
  2786. case 232:
  2787. ++cursor;
  2788. yych = this._charAt(cursor);
  2789. if (yych == '\n') { gotoCase = 165; continue; };
  2790. if (yych == '\r') { gotoCase = 165; continue; };
  2791. { gotoCase = 228; continue; };
  2792. case 233:
  2793. yyaccept = 3;
  2794. YYMARKER = ++cursor;
  2795. yych = this._charAt(cursor);
  2796. if (yych == '\n') { gotoCase = 217; continue; };
  2797. if (yych == '\r') { gotoCase = 217; continue; };
  2798. { gotoCase = 230; continue; };
  2799. case 234:
  2800. yyaccept = 2;
  2801. YYMARKER = ++cursor;
  2802. yych = this._charAt(cursor);
  2803. if (yych <= 'D') {
  2804. if (yych <= '/') { gotoCase = 155; continue; };
  2805. if (yych <= '9') { gotoCase = 234; continue; };
  2806. { gotoCase = 155; continue; };
  2807. } else {
  2808. if (yych <= 'E') { gotoCase = 236; continue; };
  2809. if (yych != 'e') { gotoCase = 155; continue; };
  2810. }
  2811. case 236:
  2812. yych = this._charAt(++cursor);
  2813. if (yych <= ',') {
  2814. if (yych != '+') { gotoCase = 165; continue; };
  2815. } else {
  2816. if (yych <= '-') { gotoCase = 237; continue; };
  2817. if (yych <= '/') { gotoCase = 165; continue; };
  2818. if (yych <= '9') { gotoCase = 238; continue; };
  2819. { gotoCase = 165; continue; };
  2820. }
  2821. case 237:
  2822. yych = this._charAt(++cursor);
  2823. if (yych <= '/') { gotoCase = 165; continue; };
  2824. if (yych >= ':') { gotoCase = 165; continue; };
  2825. case 238:
  2826. ++cursor;
  2827. yych = this._charAt(cursor);
  2828. if (yych <= '/') { gotoCase = 155; continue; };
  2829. if (yych <= '9') { gotoCase = 238; continue; };
  2830. { gotoCase = 155; continue; };
  2831. case 240:
  2832. ++cursor;
  2833. yych = this._charAt(cursor);
  2834. case 241:
  2835. if (yych <= '\r') {
  2836. if (yych == '\n') { gotoCase = 165; continue; };
  2837. if (yych <= '\f') { gotoCase = 240; continue; };
  2838. { gotoCase = 165; continue; };
  2839. } else {
  2840. if (yych <= '\'') {
  2841. if (yych <= '&') { gotoCase = 240; continue; };
  2842. { gotoCase = 243; continue; };
  2843. } else {
  2844. if (yych != '\\') { gotoCase = 240; continue; };
  2845. }
  2846. }
  2847. ++cursor;
  2848. yych = this._charAt(cursor);
  2849. if (yych <= 'a') {
  2850. if (yych <= '!') {
  2851. if (yych <= '\n') {
  2852. if (yych <= '\t') { gotoCase = 165; continue; };
  2853. { gotoCase = 246; continue; };
  2854. } else {
  2855. if (yych == '\r') { gotoCase = 246; continue; };
  2856. { gotoCase = 165; continue; };
  2857. }
  2858. } else {
  2859. if (yych <= '\'') {
  2860. if (yych <= '"') { gotoCase = 240; continue; };
  2861. if (yych <= '&') { gotoCase = 165; continue; };
  2862. { gotoCase = 240; continue; };
  2863. } else {
  2864. if (yych == '\\') { gotoCase = 240; continue; };
  2865. { gotoCase = 165; continue; };
  2866. }
  2867. }
  2868. } else {
  2869. if (yych <= 'q') {
  2870. if (yych <= 'f') {
  2871. if (yych <= 'b') { gotoCase = 240; continue; };
  2872. if (yych <= 'e') { gotoCase = 165; continue; };
  2873. { gotoCase = 240; continue; };
  2874. } else {
  2875. if (yych == 'n') { gotoCase = 240; continue; };
  2876. { gotoCase = 165; continue; };
  2877. }
  2878. } else {
  2879. if (yych <= 't') {
  2880. if (yych == 's') { gotoCase = 165; continue; };
  2881. { gotoCase = 240; continue; };
  2882. } else {
  2883. if (yych <= 'u') { gotoCase = 245; continue; };
  2884. if (yych <= 'v') { gotoCase = 240; continue; };
  2885. { gotoCase = 165; continue; };
  2886. }
  2887. }
  2888. }
  2889. case 243:
  2890. ++cursor;
  2891. { this.tokenType = "javascript-string"; return cursor; }
  2892. case 245:
  2893. ++cursor;
  2894. yych = this._charAt(cursor);
  2895. if (yych <= '@') {
  2896. if (yych <= '/') { gotoCase = 165; continue; };
  2897. if (yych <= '9') { gotoCase = 248; continue; };
  2898. { gotoCase = 165; continue; };
  2899. } else {
  2900. if (yych <= 'F') { gotoCase = 248; continue; };
  2901. if (yych <= '`') { gotoCase = 165; continue; };
  2902. if (yych <= 'f') { gotoCase = 248; continue; };
  2903. { gotoCase = 165; continue; };
  2904. }
  2905. case 246:
  2906. ++cursor;
  2907. this.setLexCondition(this._lexConditions.SSTRING);
  2908. { this.tokenType = "javascript-string"; return cursor; }
  2909. case 248:
  2910. ++cursor;
  2911. yych = this._charAt(cursor);
  2912. if (yych <= '@') {
  2913. if (yych <= '/') { gotoCase = 165; continue; };
  2914. if (yych >= ':') { gotoCase = 165; continue; };
  2915. } else {
  2916. if (yych <= 'F') { gotoCase = 249; continue; };
  2917. if (yych <= '`') { gotoCase = 165; continue; };
  2918. if (yych >= 'g') { gotoCase = 165; continue; };
  2919. }
  2920. case 249:
  2921. ++cursor;
  2922. yych = this._charAt(cursor);
  2923. if (yych <= '@') {
  2924. if (yych <= '/') { gotoCase = 165; continue; };
  2925. if (yych >= ':') { gotoCase = 165; continue; };
  2926. } else {
  2927. if (yych <= 'F') { gotoCase = 250; continue; };
  2928. if (yych <= '`') { gotoCase = 165; continue; };
  2929. if (yych >= 'g') { gotoCase = 165; continue; };
  2930. }
  2931. case 250:
  2932. ++cursor;
  2933. yych = this._charAt(cursor);
  2934. if (yych <= '@') {
  2935. if (yych <= '/') { gotoCase = 165; continue; };
  2936. if (yych <= '9') { gotoCase = 240; continue; };
  2937. { gotoCase = 165; continue; };
  2938. } else {
  2939. if (yych <= 'F') { gotoCase = 240; continue; };
  2940. if (yych <= '`') { gotoCase = 165; continue; };
  2941. if (yych <= 'f') { gotoCase = 240; continue; };
  2942. { gotoCase = 165; continue; };
  2943. }
  2944. case 251:
  2945. ++cursor;
  2946. yych = this._charAt(cursor);
  2947. case 252:
  2948. if (yych <= '\r') {
  2949. if (yych == '\n') { gotoCase = 165; continue; };
  2950. if (yych <= '\f') { gotoCase = 251; continue; };
  2951. { gotoCase = 165; continue; };
  2952. } else {
  2953. if (yych <= '"') {
  2954. if (yych <= '!') { gotoCase = 251; continue; };
  2955. { gotoCase = 243; continue; };
  2956. } else {
  2957. if (yych != '\\') { gotoCase = 251; continue; };
  2958. }
  2959. }
  2960. ++cursor;
  2961. yych = this._charAt(cursor);
  2962. if (yych <= 'a') {
  2963. if (yych <= '!') {
  2964. if (yych <= '\n') {
  2965. if (yych <= '\t') { gotoCase = 165; continue; };
  2966. { gotoCase = 255; continue; };
  2967. } else {
  2968. if (yych == '\r') { gotoCase = 255; continue; };
  2969. { gotoCase = 165; continue; };
  2970. }
  2971. } else {
  2972. if (yych <= '\'') {
  2973. if (yych <= '"') { gotoCase = 251; continue; };
  2974. if (yych <= '&') { gotoCase = 165; continue; };
  2975. { gotoCase = 251; continue; };
  2976. } else {
  2977. if (yych == '\\') { gotoCase = 251; continue; };
  2978. { gotoCase = 165; continue; };
  2979. }
  2980. }
  2981. } else {
  2982. if (yych <= 'q') {
  2983. if (yych <= 'f') {
  2984. if (yych <= 'b') { gotoCase = 251; continue; };
  2985. if (yych <= 'e') { gotoCase = 165; continue; };
  2986. { gotoCase = 251; continue; };
  2987. } else {
  2988. if (yych == 'n') { gotoCase = 251; continue; };
  2989. { gotoCase = 165; continue; };
  2990. }
  2991. } else {
  2992. if (yych <= 't') {
  2993. if (yych == 's') { gotoCase = 165; continue; };
  2994. { gotoCase = 251; continue; };
  2995. } else {
  2996. if (yych <= 'u') { gotoCase = 254; continue; };
  2997. if (yych <= 'v') { gotoCase = 251; continue; };
  2998. { gotoCase = 165; continue; };
  2999. }
  3000. }
  3001. }
  3002. case 254:
  3003. ++cursor;
  3004. yych = this._charAt(cursor);
  3005. if (yych <= '@') {
  3006. if (yych <= '/') { gotoCase = 165; continue; };
  3007. if (yych <= '9') { gotoCase = 257; continue; };
  3008. { gotoCase = 165; continue; };
  3009. } else {
  3010. if (yych <= 'F') { gotoCase = 257; continue; };
  3011. if (yych <= '`') { gotoCase = 165; continue; };
  3012. if (yych <= 'f') { gotoCase = 257; continue; };
  3013. { gotoCase = 165; continue; };
  3014. }
  3015. case 255:
  3016. ++cursor;
  3017. this.setLexCondition(this._lexConditions.DSTRING);
  3018. { this.tokenType = "javascript-string"; return cursor; }
  3019. case 257:
  3020. ++cursor;
  3021. yych = this._charAt(cursor);
  3022. if (yych <= '@') {
  3023. if (yych <= '/') { gotoCase = 165; continue; };
  3024. if (yych >= ':') { gotoCase = 165; continue; };
  3025. } else {
  3026. if (yych <= 'F') { gotoCase = 258; continue; };
  3027. if (yych <= '`') { gotoCase = 165; continue; };
  3028. if (yych >= 'g') { gotoCase = 165; continue; };
  3029. }
  3030. case 258:
  3031. ++cursor;
  3032. yych = this._charAt(cursor);
  3033. if (yych <= '@') {
  3034. if (yych <= '/') { gotoCase = 165; continue; };
  3035. if (yych >= ':') { gotoCase = 165; continue; };
  3036. } else {
  3037. if (yych <= 'F') { gotoCase = 259; continue; };
  3038. if (yych <= '`') { gotoCase = 165; continue; };
  3039. if (yych >= 'g') { gotoCase = 165; continue; };
  3040. }
  3041. case 259:
  3042. ++cursor;
  3043. yych = this._charAt(cursor);
  3044. if (yych <= '@') {
  3045. if (yych <= '/') { gotoCase = 165; continue; };
  3046. if (yych <= '9') { gotoCase = 251; continue; };
  3047. { gotoCase = 165; continue; };
  3048. } else {
  3049. if (yych <= 'F') { gotoCase = 251; continue; };
  3050. if (yych <= '`') { gotoCase = 165; continue; };
  3051. if (yych <= 'f') { gotoCase = 251; continue; };
  3052. { gotoCase = 165; continue; };
  3053. }
  3054. case 260:
  3055. ++cursor;
  3056. if ((yych = this._charAt(cursor)) == '=') { gotoCase = 163; continue; };
  3057. { gotoCase = 139; continue; };
  3058.  
  3059. case this.case_REGEX:
  3060. yych = this._charAt(cursor);
  3061. if (yych <= '.') {
  3062. if (yych <= '\n') {
  3063. if (yych <= '\t') { gotoCase = 264; continue; };
  3064. { gotoCase = 265; continue; };
  3065. } else {
  3066. if (yych == '\r') { gotoCase = 265; continue; };
  3067. { gotoCase = 264; continue; };
  3068. }
  3069. } else {
  3070. if (yych <= '[') {
  3071. if (yych <= '/') { gotoCase = 267; continue; };
  3072. if (yych <= 'Z') { gotoCase = 264; continue; };
  3073. { gotoCase = 269; continue; };
  3074. } else {
  3075. if (yych <= '\\') { gotoCase = 270; continue; };
  3076. if (yych <= ']') { gotoCase = 265; continue; };
  3077. { gotoCase = 264; continue; };
  3078. }
  3079. }
  3080. case 263:
  3081. { this.tokenType = "javascript-regexp"; return cursor; }
  3082. case 264:
  3083. yyaccept = 0;
  3084. yych = this._charAt(YYMARKER = ++cursor);
  3085. { gotoCase = 272; continue; };
  3086. case 265:
  3087. ++cursor;
  3088. case 266:
  3089. { this.tokenType = null; return cursor; }
  3090. case 267:
  3091. ++cursor;
  3092. yych = this._charAt(cursor);
  3093. { gotoCase = 278; continue; };
  3094. case 268:
  3095. this.setLexCondition(this._lexConditions.NODIV);
  3096. { this.tokenType = "javascript-regexp"; return cursor; }
  3097. case 269:
  3098. yyaccept = 1;
  3099. yych = this._charAt(YYMARKER = ++cursor);
  3100. if (yych <= '\r') {
  3101. if (yych == '\n') { gotoCase = 266; continue; };
  3102. if (yych <= '\f') { gotoCase = 276; continue; };
  3103. { gotoCase = 266; continue; };
  3104. } else {
  3105. if (yych <= '*') {
  3106. if (yych <= ')') { gotoCase = 276; continue; };
  3107. { gotoCase = 266; continue; };
  3108. } else {
  3109. if (yych == '/') { gotoCase = 266; continue; };
  3110. { gotoCase = 276; continue; };
  3111. }
  3112. }
  3113. case 270:
  3114. yych = this._charAt(++cursor);
  3115. if (yych == '\n') { gotoCase = 266; continue; };
  3116. if (yych == '\r') { gotoCase = 266; continue; };
  3117. case 271:
  3118. yyaccept = 0;
  3119. YYMARKER = ++cursor;
  3120. yych = this._charAt(cursor);
  3121. case 272:
  3122. if (yych <= '.') {
  3123. if (yych <= '\n') {
  3124. if (yych <= '\t') { gotoCase = 271; continue; };
  3125. { gotoCase = 263; continue; };
  3126. } else {
  3127. if (yych == '\r') { gotoCase = 263; continue; };
  3128. { gotoCase = 271; continue; };
  3129. }
  3130. } else {
  3131. if (yych <= '[') {
  3132. if (yych <= '/') { gotoCase = 277; continue; };
  3133. if (yych <= 'Z') { gotoCase = 271; continue; };
  3134. { gotoCase = 275; continue; };
  3135. } else {
  3136. if (yych <= '\\') { gotoCase = 273; continue; };
  3137. if (yych <= ']') { gotoCase = 263; continue; };
  3138. { gotoCase = 271; continue; };
  3139. }
  3140. }
  3141. case 273:
  3142. ++cursor;
  3143. yych = this._charAt(cursor);
  3144. if (yych == '\n') { gotoCase = 274; continue; };
  3145. if (yych != '\r') { gotoCase = 271; continue; };
  3146. case 274:
  3147. cursor = YYMARKER;
  3148. if (yyaccept <= 0) {
  3149. { gotoCase = 263; continue; };
  3150. } else {
  3151. { gotoCase = 266; continue; };
  3152. }
  3153. case 275:
  3154. ++cursor;
  3155. yych = this._charAt(cursor);
  3156. case 276:
  3157. if (yych <= '*') {
  3158. if (yych <= '\f') {
  3159. if (yych == '\n') { gotoCase = 274; continue; };
  3160. { gotoCase = 275; continue; };
  3161. } else {
  3162. if (yych <= '\r') { gotoCase = 274; continue; };
  3163. if (yych <= ')') { gotoCase = 275; continue; };
  3164. { gotoCase = 274; continue; };
  3165. }
  3166. } else {
  3167. if (yych <= '[') {
  3168. if (yych == '/') { gotoCase = 274; continue; };
  3169. { gotoCase = 275; continue; };
  3170. } else {
  3171. if (yych <= '\\') { gotoCase = 281; continue; };
  3172. if (yych <= ']') { gotoCase = 279; continue; };
  3173. { gotoCase = 275; continue; };
  3174. }
  3175. }
  3176. case 277:
  3177. ++cursor;
  3178. yych = this._charAt(cursor);
  3179. case 278:
  3180. if (yych <= 'h') {
  3181. if (yych == 'g') { gotoCase = 277; continue; };
  3182. { gotoCase = 268; continue; };
  3183. } else {
  3184. if (yych <= 'i') { gotoCase = 277; continue; };
  3185. if (yych == 'm') { gotoCase = 277; continue; };
  3186. { gotoCase = 268; continue; };
  3187. }
  3188. case 279:
  3189. yyaccept = 0;
  3190. YYMARKER = ++cursor;
  3191. yych = this._charAt(cursor);
  3192. if (yych <= '*') {
  3193. if (yych <= '\f') {
  3194. if (yych == '\n') { gotoCase = 263; continue; };
  3195. { gotoCase = 279; continue; };
  3196. } else {
  3197. if (yych <= '\r') { gotoCase = 263; continue; };
  3198. if (yych <= ')') { gotoCase = 279; continue; };
  3199. { gotoCase = 271; continue; };
  3200. }
  3201. } else {
  3202. if (yych <= 'Z') {
  3203. if (yych == '/') { gotoCase = 277; continue; };
  3204. { gotoCase = 279; continue; };
  3205. } else {
  3206. if (yych <= '[') { gotoCase = 275; continue; };
  3207. if (yych <= '\\') { gotoCase = 282; continue; };
  3208. { gotoCase = 279; continue; };
  3209. }
  3210. }
  3211. case 281:
  3212. ++cursor;
  3213. yych = this._charAt(cursor);
  3214. if (yych == '\n') { gotoCase = 274; continue; };
  3215. if (yych == '\r') { gotoCase = 274; continue; };
  3216. { gotoCase = 275; continue; };
  3217. case 282:
  3218. ++cursor;
  3219. yych = this._charAt(cursor);
  3220. if (yych == '\n') { gotoCase = 274; continue; };
  3221. if (yych == '\r') { gotoCase = 274; continue; };
  3222. { gotoCase = 279; continue; };
  3223.  
  3224. case this.case_SSTRING:
  3225. yych = this._charAt(cursor);
  3226. if (yych <= '\r') {
  3227. if (yych == '\n') { gotoCase = 287; continue; };
  3228. if (yych <= '\f') { gotoCase = 286; continue; };
  3229. { gotoCase = 287; continue; };
  3230. } else {
  3231. if (yych <= '\'') {
  3232. if (yych <= '&') { gotoCase = 286; continue; };
  3233. { gotoCase = 289; continue; };
  3234. } else {
  3235. if (yych == '\\') { gotoCase = 291; continue; };
  3236. { gotoCase = 286; continue; };
  3237. }
  3238. }
  3239. case 285:
  3240. { this.tokenType = "javascript-string"; return cursor; }
  3241. case 286:
  3242. yyaccept = 0;
  3243. yych = this._charAt(YYMARKER = ++cursor);
  3244. { gotoCase = 293; continue; };
  3245. case 287:
  3246. ++cursor;
  3247. case 288:
  3248. { this.tokenType = null; return cursor; }
  3249. case 289:
  3250. ++cursor;
  3251. case 290:
  3252. this.setLexCondition(this._lexConditions.NODIV);
  3253. { this.tokenType = "javascript-string"; return cursor; }
  3254. case 291:
  3255. yyaccept = 1;
  3256. yych = this._charAt(YYMARKER = ++cursor);
  3257. if (yych <= 'e') {
  3258. if (yych <= '\'') {
  3259. if (yych == '"') { gotoCase = 292; continue; };
  3260. if (yych <= '&') { gotoCase = 288; continue; };
  3261. } else {
  3262. if (yych <= '\\') {
  3263. if (yych <= '[') { gotoCase = 288; continue; };
  3264. } else {
  3265. if (yych != 'b') { gotoCase = 288; continue; };
  3266. }
  3267. }
  3268. } else {
  3269. if (yych <= 'r') {
  3270. if (yych <= 'm') {
  3271. if (yych >= 'g') { gotoCase = 288; continue; };
  3272. } else {
  3273. if (yych <= 'n') { gotoCase = 292; continue; };
  3274. if (yych <= 'q') { gotoCase = 288; continue; };
  3275. }
  3276. } else {
  3277. if (yych <= 't') {
  3278. if (yych <= 's') { gotoCase = 288; continue; };
  3279. } else {
  3280. if (yych <= 'u') { gotoCase = 294; continue; };
  3281. if (yych >= 'w') { gotoCase = 288; continue; };
  3282. }
  3283. }
  3284. }
  3285. case 292:
  3286. yyaccept = 0;
  3287. YYMARKER = ++cursor;
  3288. yych = this._charAt(cursor);
  3289. case 293:
  3290. if (yych <= '\r') {
  3291. if (yych == '\n') { gotoCase = 285; continue; };
  3292. if (yych <= '\f') { gotoCase = 292; continue; };
  3293. { gotoCase = 285; continue; };
  3294. } else {
  3295. if (yych <= '\'') {
  3296. if (yych <= '&') { gotoCase = 292; continue; };
  3297. { gotoCase = 300; continue; };
  3298. } else {
  3299. if (yych == '\\') { gotoCase = 299; continue; };
  3300. { gotoCase = 292; continue; };
  3301. }
  3302. }
  3303. case 294:
  3304. ++cursor;
  3305. yych = this._charAt(cursor);
  3306. if (yych <= '@') {
  3307. if (yych <= '/') { gotoCase = 295; continue; };
  3308. if (yych <= '9') { gotoCase = 296; continue; };
  3309. } else {
  3310. if (yych <= 'F') { gotoCase = 296; continue; };
  3311. if (yych <= '`') { gotoCase = 295; continue; };
  3312. if (yych <= 'f') { gotoCase = 296; continue; };
  3313. }
  3314. case 295:
  3315. cursor = YYMARKER;
  3316. if (yyaccept <= 0) {
  3317. { gotoCase = 285; continue; };
  3318. } else {
  3319. { gotoCase = 288; continue; };
  3320. }
  3321. case 296:
  3322. ++cursor;
  3323. yych = this._charAt(cursor);
  3324. if (yych <= '@') {
  3325. if (yych <= '/') { gotoCase = 295; continue; };
  3326. if (yych >= ':') { gotoCase = 295; continue; };
  3327. } else {
  3328. if (yych <= 'F') { gotoCase = 297; continue; };
  3329. if (yych <= '`') { gotoCase = 295; continue; };
  3330. if (yych >= 'g') { gotoCase = 295; continue; };
  3331. }
  3332. case 297:
  3333. ++cursor;
  3334. yych = this._charAt(cursor);
  3335. if (yych <= '@') {
  3336. if (yych <= '/') { gotoCase = 295; continue; };
  3337. if (yych >= ':') { gotoCase = 295; continue; };
  3338. } else {
  3339. if (yych <= 'F') { gotoCase = 298; continue; };
  3340. if (yych <= '`') { gotoCase = 295; continue; };
  3341. if (yych >= 'g') { gotoCase = 295; continue; };
  3342. }
  3343. case 298:
  3344. ++cursor;
  3345. yych = this._charAt(cursor);
  3346. if (yych <= '@') {
  3347. if (yych <= '/') { gotoCase = 295; continue; };
  3348. if (yych <= '9') { gotoCase = 292; continue; };
  3349. { gotoCase = 295; continue; };
  3350. } else {
  3351. if (yych <= 'F') { gotoCase = 292; continue; };
  3352. if (yych <= '`') { gotoCase = 295; continue; };
  3353. if (yych <= 'f') { gotoCase = 292; continue; };
  3354. { gotoCase = 295; continue; };
  3355. }
  3356. case 299:
  3357. ++cursor;
  3358. yych = this._charAt(cursor);
  3359. if (yych <= 'e') {
  3360. if (yych <= '\'') {
  3361. if (yych == '"') { gotoCase = 292; continue; };
  3362. if (yych <= '&') { gotoCase = 295; continue; };
  3363. { gotoCase = 292; continue; };
  3364. } else {
  3365. if (yych <= '\\') {
  3366. if (yych <= '[') { gotoCase = 295; continue; };
  3367. { gotoCase = 292; continue; };
  3368. } else {
  3369. if (yych == 'b') { gotoCase = 292; continue; };
  3370. { gotoCase = 295; continue; };
  3371. }
  3372. }
  3373. } else {
  3374. if (yych <= 'r') {
  3375. if (yych <= 'm') {
  3376. if (yych <= 'f') { gotoCase = 292; continue; };
  3377. { gotoCase = 295; continue; };
  3378. } else {
  3379. if (yych <= 'n') { gotoCase = 292; continue; };
  3380. if (yych <= 'q') { gotoCase = 295; continue; };
  3381. { gotoCase = 292; continue; };
  3382. }
  3383. } else {
  3384. if (yych <= 't') {
  3385. if (yych <= 's') { gotoCase = 295; continue; };
  3386. { gotoCase = 292; continue; };
  3387. } else {
  3388. if (yych <= 'u') { gotoCase = 294; continue; };
  3389. if (yych <= 'v') { gotoCase = 292; continue; };
  3390. { gotoCase = 295; continue; };
  3391. }
  3392. }
  3393. }
  3394. case 300:
  3395. ++cursor;
  3396. yych = this._charAt(cursor);
  3397. { gotoCase = 290; continue; };
  3398. }
  3399.  
  3400. }
  3401. },
  3402.  
  3403. __proto__: WebInspector.SourceTokenizer.prototype
  3404. }
  3405. ;
  3406.  
  3407. HTMLScriptFormatter = function(indentString)
  3408. {
  3409. WebInspector.SourceHTMLTokenizer.call(this);
  3410. this._indentString = indentString;
  3411. }
  3412.  
  3413. HTMLScriptFormatter.prototype = {
  3414. format: function(content)
  3415. {
  3416. this.line = content;
  3417. this._content = content;
  3418. this._formattedContent = "";
  3419. this._mapping = { original: [0], formatted: [0] };
  3420. this._position = 0;
  3421.  
  3422. var cursor = 0;
  3423. while (cursor < this._content.length)
  3424. cursor = this.nextToken(cursor);
  3425.  
  3426. this._formattedContent += this._content.substring(this._position);
  3427. return { content: this._formattedContent, mapping: this._mapping };
  3428. },
  3429.  
  3430. scriptStarted: function(cursor)
  3431. {
  3432. this._formattedContent += this._content.substring(this._position, cursor);
  3433. this._formattedContent += "\n";
  3434. this._position = cursor;
  3435. },
  3436.  
  3437. scriptEnded: function(cursor)
  3438. {
  3439. if (cursor === this._position)
  3440. return;
  3441.  
  3442. var scriptContent = this._content.substring(this._position, cursor);
  3443. this._mapping.original.push(this._position);
  3444. this._mapping.formatted.push(this._formattedContent.length);
  3445. var formattedScriptContent = formatScript(scriptContent, this._mapping, this._position, this._formattedContent.length, this._indentString);
  3446.  
  3447. this._formattedContent += formattedScriptContent;
  3448. this._position = cursor;
  3449. },
  3450.  
  3451. styleSheetStarted: function(cursor)
  3452. {
  3453. },
  3454.  
  3455. styleSheetEnded: function(cursor)
  3456. {
  3457. },
  3458.  
  3459. __proto__: WebInspector.SourceHTMLTokenizer.prototype
  3460. }
  3461.  
  3462. function require()
  3463. {
  3464. return parse;
  3465. }
  3466.  
  3467. var exports = {};
  3468.  
  3469.  
  3470.  
  3471.  
  3472. var KEYWORDS = array_to_hash([
  3473. "break",
  3474. "case",
  3475. "catch",
  3476. "const",
  3477. "continue",
  3478. "default",
  3479. "delete",
  3480. "do",
  3481. "else",
  3482. "finally",
  3483. "for",
  3484. "function",
  3485. "if",
  3486. "in",
  3487. "instanceof",
  3488. "new",
  3489. "return",
  3490. "switch",
  3491. "throw",
  3492. "try",
  3493. "typeof",
  3494. "var",
  3495. "void",
  3496. "while",
  3497. "with"
  3498. ]);
  3499.  
  3500. var RESERVED_WORDS = array_to_hash([
  3501. "abstract",
  3502. "boolean",
  3503. "byte",
  3504. "char",
  3505. "class",
  3506. "debugger",
  3507. "double",
  3508. "enum",
  3509. "export",
  3510. "extends",
  3511. "final",
  3512. "float",
  3513. "goto",
  3514. "implements",
  3515. "import",
  3516. "int",
  3517. "interface",
  3518. "long",
  3519. "native",
  3520. "package",
  3521. "private",
  3522. "protected",
  3523. "public",
  3524. "short",
  3525. "static",
  3526. "super",
  3527. "synchronized",
  3528. "throws",
  3529. "transient",
  3530. "volatile"
  3531. ]);
  3532.  
  3533. var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([
  3534. "return",
  3535. "new",
  3536. "delete",
  3537. "throw",
  3538. "else",
  3539. "case"
  3540. ]);
  3541.  
  3542. var KEYWORDS_ATOM = array_to_hash([
  3543. "false",
  3544. "null",
  3545. "true",
  3546. "undefined"
  3547. ]);
  3548.  
  3549. var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^"));
  3550.  
  3551. var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;
  3552. var RE_OCT_NUMBER = /^0[0-7]+$/;
  3553. var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
  3554.  
  3555. var OPERATORS = array_to_hash([
  3556. "in",
  3557. "instanceof",
  3558. "typeof",
  3559. "new",
  3560. "void",
  3561. "delete",
  3562. "++",
  3563. "--",
  3564. "+",
  3565. "-",
  3566. "!",
  3567. "~",
  3568. "&",
  3569. "|",
  3570. "^",
  3571. "*",
  3572. "/",
  3573. "%",
  3574. ">>",
  3575. "<<",
  3576. ">>>",
  3577. "<",
  3578. ">",
  3579. "<=",
  3580. ">=",
  3581. "==",
  3582. "===",
  3583. "!=",
  3584. "!==",
  3585. "?",
  3586. "=",
  3587. "+=",
  3588. "-=",
  3589. "/=",
  3590. "*=",
  3591. "%=",
  3592. ">>=",
  3593. "<<=",
  3594. ">>>=",
  3595. "%=",
  3596. "|=",
  3597. "^=",
  3598. "&=",
  3599. "&&",
  3600. "||"
  3601. ]);
  3602.  
  3603. var WHITESPACE_CHARS = array_to_hash(characters(" \n\r\t"));
  3604.  
  3605. var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:"));
  3606.  
  3607. var PUNC_CHARS = array_to_hash(characters("[]{}(),;:"));
  3608.  
  3609. var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy"));
  3610.  
  3611.  
  3612.  
  3613. function is_alphanumeric_char(ch) {
  3614. ch = ch.charCodeAt(0);
  3615. return (ch >= 48 && ch <= 57) ||
  3616. (ch >= 65 && ch <= 90) ||
  3617. (ch >= 97 && ch <= 122);
  3618. };
  3619.  
  3620. function is_identifier_char(ch) {
  3621. return is_alphanumeric_char(ch) || ch == "$" || ch == "_";
  3622. };
  3623.  
  3624. function is_digit(ch) {
  3625. ch = ch.charCodeAt(0);
  3626. return ch >= 48 && ch <= 57;
  3627. };
  3628.  
  3629. function parse_js_number(num) {
  3630. if (RE_HEX_NUMBER.test(num)) {
  3631. return parseInt(num.substr(2), 16);
  3632. } else if (RE_OCT_NUMBER.test(num)) {
  3633. return parseInt(num.substr(1), 8);
  3634. } else if (RE_DEC_NUMBER.test(num)) {
  3635. return parseFloat(num);
  3636. }
  3637. };
  3638.  
  3639. function JS_Parse_Error(message, line, col, pos) {
  3640. this.message = message;
  3641. this.line = line;
  3642. this.col = col;
  3643. this.pos = pos;
  3644. try {
  3645. ({})();
  3646. } catch(ex) {
  3647. this.stack = ex.stack;
  3648. };
  3649. };
  3650.  
  3651. JS_Parse_Error.prototype.toString = function() {
  3652. return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack;
  3653. };
  3654.  
  3655. function js_error(message, line, col, pos) {
  3656. throw new JS_Parse_Error(message, line, col, pos);
  3657. };
  3658.  
  3659. function is_token(token, type, val) {
  3660. return token.type == type && (val == null || token.value == val);
  3661. };
  3662.  
  3663. var EX_EOF = {};
  3664.  
  3665. function tokenizer($TEXT) {
  3666.  
  3667. var S = {
  3668. text            : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''),
  3669. pos             : 0,
  3670. tokpos          : 0,
  3671. line            : 0,
  3672. tokline         : 0,
  3673. col             : 0,
  3674. tokcol          : 0,
  3675. newline_before  : false,
  3676. regex_allowed   : false,
  3677. comments_before : []
  3678. };
  3679.  
  3680. function peek() { return S.text.charAt(S.pos); };
  3681.  
  3682. function next(signal_eof) {
  3683. var ch = S.text.charAt(S.pos++);
  3684. if (signal_eof && !ch)
  3685. throw EX_EOF;
  3686. if (ch == "\n") {
  3687. S.newline_before = true;
  3688. ++S.line;
  3689. S.col = 0;
  3690. } else {
  3691. ++S.col;
  3692. }
  3693. return ch;
  3694. };
  3695.  
  3696. function eof() {
  3697. return !S.peek();
  3698. };
  3699.  
  3700. function find(what, signal_eof) {
  3701. var pos = S.text.indexOf(what, S.pos);
  3702. if (signal_eof && pos == -1) throw EX_EOF;
  3703. return pos;
  3704. };
  3705.  
  3706. function start_token() {
  3707. S.tokline = S.line;
  3708. S.tokcol = S.col;
  3709. S.tokpos = S.pos;
  3710. };
  3711.  
  3712. function token(type, value, is_comment) {
  3713. S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) ||
  3714. (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) ||
  3715. (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value)));
  3716. var ret = {
  3717. type  : type,
  3718. value : value,
  3719. line  : S.tokline,
  3720. col   : S.tokcol,
  3721. pos   : S.tokpos,
  3722. nlb   : S.newline_before
  3723. };
  3724. if (!is_comment) {
  3725. ret.comments_before = S.comments_before;
  3726. S.comments_before = [];
  3727. }
  3728. S.newline_before = false;
  3729. return ret;
  3730. };
  3731.  
  3732. function skip_whitespace() {
  3733. while (HOP(WHITESPACE_CHARS, peek()))
  3734. next();
  3735. };
  3736.  
  3737. function read_while(pred) {
  3738. var ret = "", ch = peek(), i = 0;
  3739. while (ch && pred(ch, i++)) {
  3740. ret += next();
  3741. ch = peek();
  3742. }
  3743. return ret;
  3744. };
  3745.  
  3746. function parse_error(err) {
  3747. js_error(err, S.tokline, S.tokcol, S.tokpos);
  3748. };
  3749.  
  3750. function read_num(prefix) {
  3751. var has_e = false, after_e = false, has_x = false, has_dot = prefix == ".";
  3752. var num = read_while(function(ch, i){
  3753. if (ch == "x" || ch == "X") {
  3754. if (has_x) return false;
  3755. return has_x = true;
  3756. }
  3757. if (!has_x && (ch == "E" || ch == "e")) {
  3758. if (has_e) return false;
  3759. return has_e = after_e = true;
  3760. }
  3761. if (ch == "-") {
  3762. if (after_e || (i == 0 && !prefix)) return true;
  3763. return false;
  3764. }
  3765. if (ch == "+") return after_e;
  3766. after_e = false;
  3767. if (ch == ".") {
  3768. if (!has_dot)
  3769. return has_dot = true;
  3770. return false;
  3771. }
  3772. return is_alphanumeric_char(ch);
  3773. });
  3774. if (prefix)
  3775. num = prefix + num;
  3776. var valid = parse_js_number(num);
  3777. if (!isNaN(valid)) {
  3778. return token("num", valid);
  3779. } else {
  3780. parse_error("Invalid syntax: " + num);
  3781. }
  3782. };
  3783.  
  3784. function read_escaped_char() {
  3785. var ch = next(true);
  3786. switch (ch) {
  3787. case "n" : return "\n";
  3788. case "r" : return "\r";
  3789. case "t" : return "\t";
  3790. case "b" : return "\b";
  3791. case "v" : return "\v";
  3792. case "f" : return "\f";
  3793. case "0" : return "\0";
  3794. case "x" : return String.fromCharCode(hex_bytes(2));
  3795. case "u" : return String.fromCharCode(hex_bytes(4));
  3796. default  : return ch;
  3797. }
  3798. };
  3799.  
  3800. function hex_bytes(n) {
  3801. var num = 0;
  3802. for (; n > 0; --n) {
  3803. var digit = parseInt(next(true), 16);
  3804. if (isNaN(digit))
  3805. parse_error("Invalid hex-character pattern in string");
  3806. num = (num << 4) | digit;
  3807. }
  3808. return num;
  3809. };
  3810.  
  3811. function read_string() {
  3812. return with_eof_error("Unterminated string constant", function(){
  3813. var quote = next(), ret = "";
  3814. for (;;) {
  3815. var ch = next(true);
  3816. if (ch == "\\") ch = read_escaped_char();
  3817. else if (ch == quote) break;
  3818. ret += ch;
  3819. }
  3820. return token("string", ret);
  3821. });
  3822. };
  3823.  
  3824. function read_line_comment() {
  3825. next();
  3826. var i = find("\n"), ret;
  3827. if (i == -1) {
  3828. ret = S.text.substr(S.pos);
  3829. S.pos = S.text.length;
  3830. } else {
  3831. ret = S.text.substring(S.pos, i);
  3832. S.pos = i;
  3833. }
  3834. return token("comment1", ret, true);
  3835. };
  3836.  
  3837. function read_multiline_comment() {
  3838. next();
  3839. return with_eof_error("Unterminated multiline comment", function(){
  3840. var i = find("*/", true),
  3841. text = S.text.substring(S.pos, i),
  3842. tok = token("comment2", text, true);
  3843. S.pos = i + 2;
  3844. S.line += text.split("\n").length - 1;
  3845. S.newline_before = text.indexOf("\n") >= 0;
  3846. return tok;
  3847. });
  3848. };
  3849.  
  3850. function read_regexp() {
  3851. return with_eof_error("Unterminated regular expression", function(){
  3852. var prev_backslash = false, regexp = "", ch, in_class = false;
  3853. while ((ch = next(true))) if (prev_backslash) {
  3854. regexp += "\\" + ch;
  3855. prev_backslash = false;
  3856. } else if (ch == "[") {
  3857. in_class = true;
  3858. regexp += ch;
  3859. } else if (ch == "]" && in_class) {
  3860. in_class = false;
  3861. regexp += ch;
  3862. } else if (ch == "/" && !in_class) {
  3863. break;
  3864. } else if (ch == "\\") {
  3865. prev_backslash = true;
  3866. } else {
  3867. regexp += ch;
  3868. }
  3869. var mods = read_while(function(ch){
  3870. return HOP(REGEXP_MODIFIERS, ch);
  3871. });
  3872. return token("regexp", [ regexp, mods ]);
  3873. });
  3874. };
  3875.  
  3876. function read_operator(prefix) {
  3877. function grow(op) {
  3878. if (!peek()) return op;
  3879. var bigger = op + peek();
  3880. if (HOP(OPERATORS, bigger)) {
  3881. next();
  3882. return grow(bigger);
  3883. } else {
  3884. return op;
  3885. }
  3886. };
  3887. return token("operator", grow(prefix || next()));
  3888. };
  3889.  
  3890. function handle_slash() {
  3891. next();
  3892. var regex_allowed = S.regex_allowed;
  3893. switch (peek()) {
  3894. case "/":
  3895. S.comments_before.push(read_line_comment());
  3896. S.regex_allowed = regex_allowed;
  3897. return next_token();
  3898. case "*":
  3899. S.comments_before.push(read_multiline_comment());
  3900. S.regex_allowed = regex_allowed;
  3901. return next_token();
  3902. }
  3903. return S.regex_allowed ? read_regexp() : read_operator("/");
  3904. };
  3905.  
  3906. function handle_dot() {
  3907. next();
  3908. return is_digit(peek())
  3909. ? read_num(".")
  3910. : token("punc", ".");
  3911. };
  3912.  
  3913. function read_word() {
  3914. var word = read_while(is_identifier_char);
  3915. return !HOP(KEYWORDS, word)
  3916. ? token("name", word)
  3917. : HOP(OPERATORS, word)
  3918. ? token("operator", word)
  3919. : HOP(KEYWORDS_ATOM, word)
  3920. ? token("atom", word)
  3921. : token("keyword", word);
  3922. };
  3923.  
  3924. function with_eof_error(eof_error, cont) {
  3925. try {
  3926. return cont();
  3927. } catch(ex) {
  3928. if (ex === EX_EOF) parse_error(eof_error);
  3929. else throw ex;
  3930. }
  3931. };
  3932.  
  3933. function next_token(force_regexp) {
  3934. if (force_regexp)
  3935. return read_regexp();
  3936. skip_whitespace();
  3937. start_token();
  3938. var ch = peek();
  3939. if (!ch) return token("eof");
  3940. if (is_digit(ch)) return read_num();
  3941. if (ch == '"' || ch == "'") return read_string();
  3942. if (HOP(PUNC_CHARS, ch)) return token("punc", next());
  3943. if (ch == ".") return handle_dot();
  3944. if (ch == "/") return handle_slash();
  3945. if (HOP(OPERATOR_CHARS, ch)) return read_operator();
  3946. if (is_identifier_char(ch)) return read_word();
  3947. parse_error("Unexpected character '" + ch + "'");
  3948. };
  3949.  
  3950. next_token.context = function(nc) {
  3951. if (nc) S = nc;
  3952. return S;
  3953. };
  3954.  
  3955. return next_token;
  3956.  
  3957. };
  3958.  
  3959.  
  3960.  
  3961. var UNARY_PREFIX = array_to_hash([
  3962. "typeof",
  3963. "void",
  3964. "delete",
  3965. "--",
  3966. "++",
  3967. "!",
  3968. "~",
  3969. "-",
  3970. "+"
  3971. ]);
  3972.  
  3973. var UNARY_POSTFIX = array_to_hash([ "--", "++" ]);
  3974.  
  3975. var ASSIGNMENT = (function(a, ret, i){
  3976. while (i < a.length) {
  3977. ret[a[i]] = a[i].substr(0, a[i].length - 1);
  3978. i++;
  3979. }
  3980. return ret;
  3981. })(
  3982. ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="],
  3983. { "=": true },
  3984. 0
  3985. );
  3986.  
  3987. var PRECEDENCE = (function(a, ret){
  3988. for (var i = 0, n = 1; i < a.length; ++i, ++n) {
  3989. var b = a[i];
  3990. for (var j = 0; j < b.length; ++j) {
  3991. ret[b[j]] = n;
  3992. }
  3993. }
  3994. return ret;
  3995. })(
  3996. [
  3997. ["||"],
  3998. ["&&"],
  3999. ["|"],
  4000. ["^"],
  4001. ["&"],
  4002. ["==", "===", "!=", "!=="],
  4003. ["<", ">", "<=", ">=", "in", "instanceof"],
  4004. [">>", "<<", ">>>"],
  4005. ["+", "-"],
  4006. ["*", "/", "%"]
  4007. ],
  4008. {}
  4009. );
  4010.  
  4011. var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]);
  4012.  
  4013. var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]);
  4014.  
  4015.  
  4016.  
  4017. function NodeWithToken(str, start, end) {
  4018. this.name = str;
  4019. this.start = start;
  4020. this.end = end;
  4021. };
  4022.  
  4023. NodeWithToken.prototype.toString = function() { return this.name; };
  4024.  
  4025. function parse($TEXT, strict_mode, embed_tokens) {
  4026.  
  4027. var S = {
  4028. input       : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT,
  4029. token       : null,
  4030. prev        : null,
  4031. peeked      : null,
  4032. in_function : 0,
  4033. in_loop     : 0,
  4034. labels      : []
  4035. };
  4036.  
  4037. S.token = next();
  4038.  
  4039. function is(type, value) {
  4040. return is_token(S.token, type, value);
  4041. };
  4042.  
  4043. function peek() { return S.peeked || (S.peeked = S.input()); };
  4044.  
  4045. function next() {
  4046. S.prev = S.token;
  4047. if (S.peeked) {
  4048. S.token = S.peeked;
  4049. S.peeked = null;
  4050. } else {
  4051. S.token = S.input();
  4052. }
  4053. return S.token;
  4054. };
  4055.  
  4056. function prev() {
  4057. return S.prev;
  4058. };
  4059.  
  4060. function croak(msg, line, col, pos) {
  4061. var ctx = S.input.context();
  4062. js_error(msg,
  4063. line != null ? line : ctx.tokline,
  4064. col != null ? col : ctx.tokcol,
  4065. pos != null ? pos : ctx.tokpos);
  4066. };
  4067.  
  4068. function token_error(token, msg) {
  4069. croak(msg, token.line, token.col);
  4070. };
  4071.  
  4072. function unexpected(token) {
  4073. if (token == null)
  4074. token = S.token;
  4075. token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
  4076. };
  4077.  
  4078. function expect_token(type, val) {
  4079. if (is(type, val)) {
  4080. return next();
  4081. }
  4082. token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type);
  4083. };
  4084.  
  4085. function expect(punc) { return expect_token("punc", punc); };
  4086.  
  4087. function can_insert_semicolon() {
  4088. return !strict_mode && (
  4089. S.token.nlb || is("eof") || is("punc", "}")
  4090. );
  4091. };
  4092.  
  4093. function semicolon() {
  4094. if (is("punc", ";")) next();
  4095. else if (!can_insert_semicolon()) unexpected();
  4096. };
  4097.  
  4098. function as() {
  4099. return slice(arguments);
  4100. };
  4101.  
  4102. function parenthesised() {
  4103. expect("(");
  4104. var ex = expression();
  4105. expect(")");
  4106. return ex;
  4107. };
  4108.  
  4109. function add_tokens(str, start, end) {
  4110. return new NodeWithToken(str, start, end);
  4111. };
  4112.  
  4113. var statement = embed_tokens ? function() {
  4114. var start = S.token;
  4115. var stmt = $statement();
  4116. stmt[0] = add_tokens(stmt[0], start, prev());
  4117. return stmt;
  4118. } : $statement;
  4119.  
  4120. function $statement() {
  4121. if (is("operator", "/")) {
  4122. S.peeked = null;
  4123. S.token = S.input(true); 
  4124. }
  4125. switch (S.token.type) {
  4126. case "num":
  4127. case "string":
  4128. case "regexp":
  4129. case "operator":
  4130. case "atom":
  4131. return simple_statement();
  4132.  
  4133. case "name":
  4134. return is_token(peek(), "punc", ":")
  4135. ? labeled_statement(prog1(S.token.value, next, next))
  4136. : simple_statement();
  4137.  
  4138. case "punc":
  4139. switch (S.token.value) {
  4140. case "{":
  4141. return as("block", block_());
  4142. case "[":
  4143. case "(":
  4144. return simple_statement();
  4145. case ";":
  4146. next();
  4147. return as("block");
  4148. default:
  4149. unexpected();
  4150. }
  4151.  
  4152. case "keyword":
  4153. switch (prog1(S.token.value, next)) {
  4154. case "break":
  4155. return break_cont("break");
  4156.  
  4157. case "continue":
  4158. return break_cont("continue");
  4159.  
  4160. case "debugger":
  4161. semicolon();
  4162. return as("debugger");
  4163.  
  4164. case "do":
  4165. return (function(body){
  4166. expect_token("keyword", "while");
  4167. return as("do", prog1(parenthesised, semicolon), body);
  4168. })(in_loop(statement));
  4169.  
  4170. case "for":
  4171. return for_();
  4172.  
  4173. case "function":
  4174. return function_(true);
  4175.  
  4176. case "if":
  4177. return if_();
  4178.  
  4179. case "return":
  4180. if (S.in_function == 0)
  4181. croak("'return' outside of function");
  4182. return as("return",
  4183. is("punc", ";")
  4184. ? (next(), null)
  4185. : can_insert_semicolon()
  4186. ? null
  4187. : prog1(expression, semicolon));
  4188.  
  4189. case "switch":
  4190. return as("switch", parenthesised(), switch_block_());
  4191.  
  4192. case "throw":
  4193. return as("throw", prog1(expression, semicolon));
  4194.  
  4195. case "try":
  4196. return try_();
  4197.  
  4198. case "var":
  4199. return prog1(var_, semicolon);
  4200.  
  4201. case "const":
  4202. return prog1(const_, semicolon);
  4203.  
  4204. case "while":
  4205. return as("while", parenthesised(), in_loop(statement));
  4206.  
  4207. case "with":
  4208. return as("with", parenthesised(), statement());
  4209.  
  4210. default:
  4211. unexpected();
  4212. }
  4213. }
  4214. };
  4215.  
  4216. function labeled_statement(label) {
  4217. S.labels.push(label);
  4218. var start = S.token, stat = statement();
  4219. if (strict_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0]))
  4220. unexpected(start);
  4221. S.labels.pop();
  4222. return as("label", label, stat);
  4223. };
  4224.  
  4225. function simple_statement() {
  4226. return as("stat", prog1(expression, semicolon));
  4227. };
  4228.  
  4229. function break_cont(type) {
  4230. var name = is("name") ? S.token.value : null;
  4231. if (name != null) {
  4232. next();
  4233. if (!member(name, S.labels))
  4234. croak("Label " + name + " without matching loop or statement");
  4235. }
  4236. else if (S.in_loop == 0)
  4237. croak(type + " not inside a loop or switch");
  4238. semicolon();
  4239. return as(type, name);
  4240. };
  4241.  
  4242. function for_() {
  4243. expect("(");
  4244. var has_var = is("keyword", "var");
  4245. if (has_var)
  4246. next();
  4247. if (is("name") && is_token(peek(), "operator", "in")) {
  4248.  
  4249. var name = S.token.value;
  4250. next(); next();
  4251. var obj = expression();
  4252. expect(")");
  4253. return as("for-in", has_var, name, obj, in_loop(statement));
  4254. } else {
  4255.  
  4256. var init = is("punc", ";") ? null : has_var ? var_() : expression();
  4257. expect(";");
  4258. var test = is("punc", ";") ? null : expression();
  4259. expect(";");
  4260. var step = is("punc", ")") ? null : expression();
  4261. expect(")");
  4262. return as("for", init, test, step, in_loop(statement));
  4263. }
  4264. };
  4265.  
  4266. function function_(in_statement) {
  4267. var name = is("name") ? prog1(S.token.value, next) : null;
  4268. if (in_statement && !name)
  4269. unexpected();
  4270. expect("(");
  4271. return as(in_statement ? "defun" : "function",
  4272. name,
  4273.  
  4274. (function(first, a){
  4275. while (!is("punc", ")")) {
  4276. if (first) first = false; else expect(",");
  4277. if (!is("name")) unexpected();
  4278. a.push(S.token.value);
  4279. next();
  4280. }
  4281. next();
  4282. return a;
  4283. })(true, []),
  4284.  
  4285. (function(){
  4286. ++S.in_function;
  4287. var loop = S.in_loop;
  4288. S.in_loop = 0;
  4289. var a = block_();
  4290. --S.in_function;
  4291. S.in_loop = loop;
  4292. return a;
  4293. })());
  4294. };
  4295.  
  4296. function if_() {
  4297. var cond = parenthesised(), body = statement(), belse;
  4298. if (is("keyword", "else")) {
  4299. next();
  4300. belse = statement();
  4301. }
  4302. return as("if", cond, body, belse);
  4303. };
  4304.  
  4305. function block_() {
  4306. expect("{");
  4307. var a = [];
  4308. while (!is("punc", "}")) {
  4309. if (is("eof")) unexpected();
  4310. a.push(statement());
  4311. }
  4312. next();
  4313. return a;
  4314. };
  4315.  
  4316. var switch_block_ = curry(in_loop, function(){
  4317. expect("{");
  4318. var a = [], cur = null;
  4319. while (!is("punc", "}")) {
  4320. if (is("eof")) unexpected();
  4321. if (is("keyword", "case")) {
  4322. next();
  4323. cur = [];
  4324. a.push([ expression(), cur ]);
  4325. expect(":");
  4326. }
  4327. else if (is("keyword", "default")) {
  4328. next();
  4329. expect(":");
  4330. cur = [];
  4331. a.push([ null, cur ]);
  4332. }
  4333. else {
  4334. if (!cur) unexpected();
  4335. cur.push(statement());
  4336. }
  4337. }
  4338. next();
  4339. return a;
  4340. });
  4341.  
  4342. function try_() {
  4343. var body = block_(), bcatch, bfinally;
  4344. if (is("keyword", "catch")) {
  4345. next();
  4346. expect("(");
  4347. if (!is("name"))
  4348. croak("Name expected");
  4349. var name = S.token.value;
  4350. next();
  4351. expect(")");
  4352. bcatch = [ name, block_() ];
  4353. }
  4354. if (is("keyword", "finally")) {
  4355. next();
  4356. bfinally = block_();
  4357. }
  4358. if (!bcatch && !bfinally)
  4359. croak("Missing catch/finally blocks");
  4360. return as("try", body, bcatch, bfinally);
  4361. };
  4362.  
  4363. function vardefs() {
  4364. var a = [];
  4365. for (;;) {
  4366. if (!is("name"))
  4367. unexpected();
  4368. var name = S.token.value;
  4369. next();
  4370. if (is("operator", "=")) {
  4371. next();
  4372. a.push([ name, expression(false) ]);
  4373. } else {
  4374. a.push([ name ]);
  4375. }
  4376. if (!is("punc", ","))
  4377. break;
  4378. next();
  4379. }
  4380. return a;
  4381. };
  4382.  
  4383. function var_() {
  4384. return as("var", vardefs());
  4385. };
  4386.  
  4387. function const_() {
  4388. return as("const", vardefs());
  4389. };
  4390.  
  4391. function new_() {
  4392. var newexp = expr_atom(false), args;
  4393. if (is("punc", "(")) {
  4394. next();
  4395. args = expr_list(")");
  4396. } else {
  4397. args = [];
  4398. }
  4399. return subscripts(as("new", newexp, args), true);
  4400. };
  4401.  
  4402. function expr_atom(allow_calls) {
  4403. if (is("operator", "new")) {
  4404. next();
  4405. return new_();
  4406. }
  4407. if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) {
  4408. return make_unary("unary-prefix",
  4409. prog1(S.token.value, next),
  4410. expr_atom(allow_calls));
  4411. }
  4412. if (is("punc")) {
  4413. switch (S.token.value) {
  4414. case "(":
  4415. next();
  4416. return subscripts(prog1(expression, curry(expect, ")")), allow_calls);
  4417. case "[":
  4418. next();
  4419. return subscripts(array_(), allow_calls);
  4420. case "{":
  4421. next();
  4422. return subscripts(object_(), allow_calls);
  4423. }
  4424. unexpected();
  4425. }
  4426. if (is("keyword", "function")) {
  4427. next();
  4428. return subscripts(function_(false), allow_calls);
  4429. }
  4430. if (HOP(ATOMIC_START_TOKEN, S.token.type)) {
  4431. var atom = S.token.type == "regexp"
  4432. ? as("regexp", S.token.value[0], S.token.value[1])
  4433. : as(S.token.type, S.token.value);
  4434. return subscripts(prog1(atom, next), allow_calls);
  4435. }
  4436. unexpected();
  4437. };
  4438.  
  4439. function expr_list(closing, allow_trailing_comma, allow_empty) {
  4440. var first = true, a = [];
  4441. while (!is("punc", closing)) {
  4442. if (first) first = false; else expect(",");
  4443. if (allow_trailing_comma && is("punc", closing)) break;
  4444. if (is("punc", ",") && allow_empty) {
  4445. a.push([ "atom", "undefined" ]);
  4446. } else {
  4447. a.push(expression(false));
  4448. }
  4449. }
  4450. next();
  4451. return a;
  4452. };
  4453.  
  4454. function array_() {
  4455. return as("array", expr_list("]", !strict_mode, true));
  4456. };
  4457.  
  4458. function object_() {
  4459. var first = true, a = [];
  4460. while (!is("punc", "}")) {
  4461. if (first) first = false; else expect(",");
  4462. if (!strict_mode && is("punc", "}"))
  4463.  
  4464. break;
  4465. var type = S.token.type;
  4466. var name = as_property_name();
  4467. if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) {
  4468. a.push([ as_name(), function_(false), name ]);
  4469. } else {
  4470. expect(":");
  4471. a.push([ name, expression(false) ]);
  4472. }
  4473. }
  4474. next();
  4475. return as("object", a);
  4476. };
  4477.  
  4478. function as_property_name() {
  4479. switch (S.token.type) {
  4480. case "num":
  4481. case "string":
  4482. return prog1(S.token.value, next);
  4483. }
  4484. return as_name();
  4485. };
  4486.  
  4487. function as_name() {
  4488. switch (S.token.type) {
  4489. case "name":
  4490. case "operator":
  4491. case "keyword":
  4492. case "atom":
  4493. return prog1(S.token.value, next);
  4494. default:
  4495. unexpected();
  4496. }
  4497. };
  4498.  
  4499. function subscripts(expr, allow_calls) {
  4500. if (is("punc", ".")) {
  4501. next();
  4502. return subscripts(as("dot", expr, as_name()), allow_calls);
  4503. }
  4504. if (is("punc", "[")) {
  4505. next();
  4506. return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls);
  4507. }
  4508. if (allow_calls && is("punc", "(")) {
  4509. next();
  4510. return subscripts(as("call", expr, expr_list(")")), true);
  4511. }
  4512. if (allow_calls && is("operator") && HOP(UNARY_POSTFIX, S.token.value)) {
  4513. return prog1(curry(make_unary, "unary-postfix", S.token.value, expr),
  4514. next);
  4515. }
  4516. return expr;
  4517. };
  4518.  
  4519. function make_unary(tag, op, expr) {
  4520. if ((op == "++" || op == "--") && !is_assignable(expr))
  4521. croak("Invalid use of " + op + " operator");
  4522. return as(tag, op, expr);
  4523. };
  4524.  
  4525. function expr_op(left, min_prec) {
  4526. var op = is("operator") ? S.token.value : null;
  4527. var prec = op != null ? PRECEDENCE[op] : null;
  4528. if (prec != null && prec > min_prec) {
  4529. next();
  4530. var right = expr_op(expr_atom(true), prec);
  4531. return expr_op(as("binary", op, left, right), min_prec);
  4532. }
  4533. return left;
  4534. };
  4535.  
  4536. function expr_ops() {
  4537. return expr_op(expr_atom(true), 0);
  4538. };
  4539.  
  4540. function maybe_conditional() {
  4541. var expr = expr_ops();
  4542. if (is("operator", "?")) {
  4543. next();
  4544. var yes = expression(false);
  4545. expect(":");
  4546. return as("conditional", expr, yes, expression(false));
  4547. }
  4548. return expr;
  4549. };
  4550.  
  4551. function is_assignable(expr) {
  4552. switch (expr[0]) {
  4553. case "dot":
  4554. case "sub":
  4555. return true;
  4556. case "name":
  4557. return expr[1] != "this";
  4558. }
  4559. };
  4560.  
  4561. function maybe_assign() {
  4562. var left = maybe_conditional(), val = S.token.value;
  4563. if (is("operator") && HOP(ASSIGNMENT, val)) {
  4564. if (is_assignable(left)) {
  4565. next();
  4566. return as("assign", ASSIGNMENT[val], left, maybe_assign());
  4567. }
  4568. croak("Invalid assignment");
  4569. }
  4570. return left;
  4571. };
  4572.  
  4573. function expression(commas) {
  4574. if (arguments.length == 0)
  4575. commas = true;
  4576. var expr = maybe_assign();
  4577. if (commas && is("punc", ",")) {
  4578. next();
  4579. return as("seq", expr, expression());
  4580. }
  4581. return expr;
  4582. };
  4583.  
  4584. function in_loop(cont) {
  4585. try {
  4586. ++S.in_loop;
  4587. return cont();
  4588. } finally {
  4589. --S.in_loop;
  4590. }
  4591. };
  4592.  
  4593. return as("toplevel", (function(a){
  4594. while (!is("eof"))
  4595. a.push(statement());
  4596. return a;
  4597. })([]));
  4598.  
  4599. };
  4600.  
  4601.  
  4602.  
  4603. function curry(f) {
  4604. var args = slice(arguments, 1);
  4605. return function() { return f.apply(this, args.concat(slice(arguments))); };
  4606. };
  4607.  
  4608. function prog1(ret) {
  4609. if (ret instanceof Function)
  4610. ret = ret();
  4611. for (var i = 1, n = arguments.length; --n > 0; ++i)
  4612. arguments[i]();
  4613. return ret;
  4614. };
  4615.  
  4616. function array_to_hash(a) {
  4617. var ret = {};
  4618. for (var i = 0; i < a.length; ++i)
  4619. ret[a[i]] = true;
  4620. return ret;
  4621. };
  4622.  
  4623. function slice(a, start) {
  4624. return Array.prototype.slice.call(a, start == null ? 0 : start);
  4625. };
  4626.  
  4627. function characters(str) {
  4628. return str.split("");
  4629. };
  4630.  
  4631. function member(name, array) {
  4632. for (var i = array.length; --i >= 0;)
  4633. if (array[i] === name)
  4634. return true;
  4635. return false;
  4636. };
  4637.  
  4638. function HOP(obj, prop) {
  4639. return Object.prototype.hasOwnProperty.call(obj, prop);
  4640. };
  4641.  
  4642.  
  4643.  
  4644. exports.tokenizer = tokenizer;
  4645. exports.parse = parse;
  4646. exports.slice = slice;
  4647. exports.curry = curry;
  4648. exports.member = member;
  4649. exports.array_to_hash = array_to_hash;
  4650. exports.PRECEDENCE = PRECEDENCE;
  4651. exports.KEYWORDS_ATOM = KEYWORDS_ATOM;
  4652. exports.RESERVED_WORDS = RESERVED_WORDS;
  4653. exports.KEYWORDS = KEYWORDS;
  4654. exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;
  4655. exports.OPERATORS = OPERATORS;
  4656. exports.is_alphanumeric_char = is_alphanumeric_char;
  4657. exports.is_identifier_char = is_identifier_char;
  4658. ;
  4659. var parse = exports;
  4660.  
  4661.  
  4662.  
  4663. function FormattedContentBuilder(content, mapping, originalOffset, formattedOffset, indentString)
  4664. {
  4665. this._originalContent = content;
  4666. this._originalOffset = originalOffset;
  4667. this._lastOriginalPosition = 0;
  4668.  
  4669. this._formattedContent = [];
  4670. this._formattedContentLength = 0;
  4671. this._formattedOffset = formattedOffset;
  4672. this._lastFormattedPosition = 0;
  4673.  
  4674. this._mapping = mapping;
  4675.  
  4676. this._lineNumber = 0;
  4677. this._nestingLevel = 0;
  4678. this._indentString = indentString;
  4679. this._cachedIndents = {};
  4680. }
  4681.  
  4682. FormattedContentBuilder.prototype = {
  4683. addToken: function(token)
  4684. {
  4685. for (var i = 0; i < token.comments_before.length; ++i)
  4686. this._addComment(token.comments_before[i]);
  4687.  
  4688. while (this._lineNumber < token.line) {
  4689. this._addText("\n");
  4690. this._addIndent();
  4691. this._needNewLine = false;
  4692. this._lineNumber += 1;
  4693. }
  4694.  
  4695. if (this._needNewLine) {
  4696. this._addText("\n");
  4697. this._addIndent();
  4698. this._needNewLine = false;
  4699. }
  4700.  
  4701. this._addMappingIfNeeded(token.pos);
  4702. this._addText(this._originalContent.substring(token.pos, token.endPos));
  4703. this._lineNumber = token.endLine;
  4704. },
  4705.  
  4706. addSpace: function()
  4707. {
  4708. this._addText(" ");
  4709. },
  4710.  
  4711. addNewLine: function()
  4712. {
  4713. this._needNewLine = true;
  4714. },
  4715.  
  4716. increaseNestingLevel: function()
  4717. {
  4718. this._nestingLevel += 1;
  4719. },
  4720.  
  4721. decreaseNestingLevel: function()
  4722. {
  4723. this._nestingLevel -= 1;
  4724. },
  4725.  
  4726. content: function()
  4727. {
  4728. return this._formattedContent.join("");
  4729. },
  4730.  
  4731. mapping: function()
  4732. {
  4733. return { original: this._originalPositions, formatted: this._formattedPositions };
  4734. },
  4735.  
  4736. _addIndent: function()
  4737. {
  4738. if (this._cachedIndents[this._nestingLevel]) {
  4739. this._addText(this._cachedIndents[this._nestingLevel]);
  4740. return;
  4741. }
  4742.  
  4743. var fullIndent = "";
  4744. for (var i = 0; i < this._nestingLevel; ++i)
  4745. fullIndent += this._indentString;
  4746. this._addText(fullIndent);
  4747.  
  4748.  
  4749. if (this._nestingLevel <= 20)
  4750. this._cachedIndents[this._nestingLevel] = fullIndent;
  4751. },
  4752.  
  4753. _addComment: function(comment)
  4754. {
  4755. if (this._lineNumber < comment.line) {
  4756. for (var j = this._lineNumber; j < comment.line; ++j)
  4757. this._addText("\n");
  4758. this._lineNumber = comment.line;
  4759. this._needNewLine = false;
  4760. this._addIndent();
  4761. } else
  4762. this.addSpace();
  4763.  
  4764. this._addMappingIfNeeded(comment.pos);
  4765. if (comment.type === "comment1")
  4766. this._addText("//");
  4767. else
  4768. this._addText("/*");
  4769.  
  4770. this._addText(comment.value);
  4771.  
  4772. if (comment.type !== "comment1") {
  4773. this._addText("*/");
  4774. var position;
  4775. while ((position = comment.value.indexOf("\n", position + 1)) !== -1)
  4776. this._lineNumber += 1;
  4777. }
  4778. },
  4779.  
  4780. _addText: function(text)
  4781. {
  4782. this._formattedContent.push(text);
  4783. this._formattedContentLength += text.length;
  4784. },
  4785.  
  4786. _addMappingIfNeeded: function(originalPosition)
  4787. {
  4788. if (originalPosition - this._lastOriginalPosition === this._formattedContentLength - this._lastFormattedPosition)
  4789. return;
  4790. this._mapping.original.push(this._originalOffset + originalPosition);
  4791. this._lastOriginalPosition = originalPosition;
  4792. this._mapping.formatted.push(this._formattedOffset + this._formattedContentLength);
  4793. this._lastFormattedPosition = this._formattedContentLength;
  4794. }
  4795. }
  4796.  
  4797. var tokens = [
  4798. ["EOS"],
  4799. ["LPAREN", "("], ["RPAREN", ")"], ["LBRACK", "["], ["RBRACK", "]"], ["LBRACE", "{"], ["RBRACE", "}"], ["COLON", ":"], ["SEMICOLON", ";"], ["PERIOD", "."], ["CONDITIONAL", "?"],
  4800. ["INC", "++"], ["DEC", "--"],
  4801. ["ASSIGN", "="], ["ASSIGN_BIT_OR", "|="], ["ASSIGN_BIT_XOR", "^="], ["ASSIGN_BIT_AND", "&="], ["ASSIGN_SHL", "<<="], ["ASSIGN_SAR", ">>="], ["ASSIGN_SHR", ">>>="],
  4802. ["ASSIGN_ADD", "+="], ["ASSIGN_SUB", "-="], ["ASSIGN_MUL", "*="], ["ASSIGN_DIV", "/="], ["ASSIGN_MOD", "%="],
  4803. ["COMMA", ","], ["OR", "||"], ["AND", "&&"], ["BIT_OR", "|"], ["BIT_XOR", "^"], ["BIT_AND", "&"], ["SHL", "<<"], ["SAR", ">>"], ["SHR", ">>>"],
  4804. ["ADD", "+"], ["SUB", "-"], ["MUL", "*"], ["DIV", "/"], ["MOD", "%"],
  4805. ["EQ", "=="], ["NE", "!="], ["EQ_STRICT", "==="], ["NE_STRICT", "!=="], ["LT", "<"], ["GT", ">"], ["LTE", "<="], ["GTE", ">="],
  4806. ["INSTANCEOF", "instanceof"], ["IN", "in"], ["NOT", "!"], ["BIT_NOT", "~"], ["DELETE", "delete"], ["TYPEOF", "typeof"], ["VOID", "void"],
  4807. ["BREAK", "break"], ["CASE", "case"], ["CATCH", "catch"], ["CONTINUE", "continue"], ["DEBUGGER", "debugger"], ["DEFAULT", "default"], ["DO", "do"], ["ELSE", "else"], ["FINALLY", "finally"],
  4808. ["FOR", "for"], ["FUNCTION", "function"], ["IF", "if"], ["NEW", "new"], ["RETURN", "return"], ["SWITCH", "switch"], ["THIS", "this"], ["THROW", "throw"], ["TRY", "try"], ["VAR", "var"],
  4809. ["WHILE", "while"], ["WITH", "with"], ["NULL_LITERAL", "null"], ["TRUE_LITERAL", "true"], ["FALSE_LITERAL", "false"], ["NUMBER"], ["STRING"], ["IDENTIFIER"], ["CONST", "const"]
  4810. ];
  4811.  
  4812. var Tokens = {};
  4813. for (var i = 0; i < tokens.length; ++i)
  4814. Tokens[tokens[i][0]] = i;
  4815.  
  4816. var TokensByValue = {};
  4817. for (var i = 0; i < tokens.length; ++i) {
  4818. if (tokens[i][1])
  4819. TokensByValue[tokens[i][1]] = i;
  4820. }
  4821.  
  4822. var TokensByType = {
  4823. "eof": Tokens.EOS,
  4824. "name": Tokens.IDENTIFIER,
  4825. "num": Tokens.NUMBER,
  4826. "regexp": Tokens.DIV,
  4827. "string": Tokens.STRING
  4828. };
  4829.  
  4830. function Tokenizer(content)
  4831. {
  4832. this._readNextToken = parse.tokenizer(content);
  4833. this._state = this._readNextToken.context();
  4834. }
  4835.  
  4836. Tokenizer.prototype = {
  4837. content: function()
  4838. {
  4839. return this._state.text;
  4840. },
  4841.  
  4842. next: function(forceRegexp)
  4843. {
  4844. var uglifyToken = this._readNextToken(forceRegexp);
  4845. uglifyToken.endPos = this._state.pos;
  4846. uglifyToken.endLine = this._state.line;
  4847. uglifyToken.token = this._convertUglifyToken(uglifyToken);
  4848. return uglifyToken;
  4849. },
  4850.  
  4851. _convertUglifyToken: function(uglifyToken)
  4852. {
  4853. var token = TokensByType[uglifyToken.type];
  4854. if (typeof token === "number")
  4855. return token;
  4856. token = TokensByValue[uglifyToken.value];
  4857. if (typeof token === "number")
  4858. return token;
  4859. throw "Unknown token type " + uglifyToken.type;
  4860. }
  4861. }
  4862.  
  4863. function JavaScriptFormatter(tokenizer, builder)
  4864. {
  4865. this._tokenizer = tokenizer;
  4866. this._builder = builder;
  4867. this._token = null;
  4868. this._nextToken = this._tokenizer.next();
  4869. }
  4870.  
  4871. JavaScriptFormatter.prototype = {
  4872. format: function()
  4873. {
  4874. this._parseSourceElements(Tokens.EOS);
  4875. this._consume(Tokens.EOS);
  4876. },
  4877.  
  4878. _peek: function()
  4879. {
  4880. return this._nextToken.token;
  4881. },
  4882.  
  4883. _next: function()
  4884. {
  4885. if (this._token && this._token.token === Tokens.EOS)
  4886. throw "Unexpected EOS token";
  4887.  
  4888. this._builder.addToken(this._nextToken);
  4889. this._token = this._nextToken;
  4890. this._nextToken = this._tokenizer.next(this._forceRegexp);
  4891. this._forceRegexp = false;
  4892. return this._token.token;
  4893. },
  4894.  
  4895. _consume: function(token)
  4896. {
  4897. var next = this._next();
  4898. if (next !== token)
  4899. throw "Unexpected token in consume: expected " + token + ", actual " + next;
  4900. },
  4901.  
  4902. _expect: function(token)
  4903. {
  4904. var next = this._next();
  4905. if (next !== token)
  4906. throw "Unexpected token: expected " + token + ", actual " + next;
  4907. },
  4908.  
  4909. _expectSemicolon: function()
  4910. {
  4911. if (this._peek() === Tokens.SEMICOLON)
  4912. this._consume(Tokens.SEMICOLON);
  4913. },
  4914.  
  4915. _hasLineTerminatorBeforeNext: function()
  4916. {
  4917. return this._nextToken.nlb;
  4918. },
  4919.  
  4920. _parseSourceElements: function(endToken)
  4921. {
  4922. while (this._peek() !== endToken) {
  4923. this._parseStatement();
  4924. this._builder.addNewLine();
  4925. }
  4926. },
  4927.  
  4928. _parseStatementOrBlock: function()
  4929. {
  4930. if (this._peek() === Tokens.LBRACE) {
  4931. this._builder.addSpace();
  4932. this._parseBlock();
  4933. return true;
  4934. }
  4935.  
  4936. this._builder.addNewLine();
  4937. this._builder.increaseNestingLevel();
  4938. this._parseStatement();
  4939. this._builder.decreaseNestingLevel();
  4940. },
  4941.  
  4942. _parseStatement: function()
  4943. {
  4944. switch (this._peek()) {
  4945. case Tokens.LBRACE:
  4946. return this._parseBlock();
  4947. case Tokens.CONST:
  4948. case Tokens.VAR:
  4949. return this._parseVariableStatement();
  4950. case Tokens.SEMICOLON:
  4951. return this._next();
  4952. case Tokens.IF:
  4953. return this._parseIfStatement();
  4954. case Tokens.DO:
  4955. return this._parseDoWhileStatement();
  4956. case Tokens.WHILE:
  4957. return this._parseWhileStatement();
  4958. case Tokens.FOR:
  4959. return this._parseForStatement();
  4960. case Tokens.CONTINUE:
  4961. return this._parseContinueStatement();
  4962. case Tokens.BREAK:
  4963. return this._parseBreakStatement();
  4964. case Tokens.RETURN:
  4965. return this._parseReturnStatement();
  4966. case Tokens.WITH:
  4967. return this._parseWithStatement();
  4968. case Tokens.SWITCH:
  4969. return this._parseSwitchStatement();
  4970. case Tokens.THROW:
  4971. return this._parseThrowStatement();
  4972. case Tokens.TRY:
  4973. return this._parseTryStatement();
  4974. case Tokens.FUNCTION:
  4975. return this._parseFunctionDeclaration();
  4976. case Tokens.DEBUGGER:
  4977. return this._parseDebuggerStatement();
  4978. default:
  4979. return this._parseExpressionOrLabelledStatement();
  4980. }
  4981. },
  4982.  
  4983. _parseFunctionDeclaration: function()
  4984. {
  4985. this._expect(Tokens.FUNCTION);
  4986. this._builder.addSpace();
  4987. this._expect(Tokens.IDENTIFIER);
  4988. this._parseFunctionLiteral()
  4989. },
  4990.  
  4991. _parseBlock: function()
  4992. {
  4993. this._expect(Tokens.LBRACE);
  4994. this._builder.addNewLine();
  4995. this._builder.increaseNestingLevel();
  4996. while (this._peek() !== Tokens.RBRACE) {
  4997. this._parseStatement();
  4998. this._builder.addNewLine();
  4999. }
  5000. this._builder.decreaseNestingLevel();
  5001. this._expect(Tokens.RBRACE);
  5002. },
  5003.  
  5004. _parseVariableStatement: function()
  5005. {
  5006. this._parseVariableDeclarations();
  5007. this._expectSemicolon();
  5008. },
  5009.  
  5010. _parseVariableDeclarations: function()
  5011. {
  5012. if (this._peek() === Tokens.VAR)
  5013. this._consume(Tokens.VAR);
  5014. else
  5015. this._consume(Tokens.CONST)
  5016. this._builder.addSpace();
  5017.  
  5018. var isFirstVariable = true;
  5019. do {
  5020. if (!isFirstVariable) {
  5021. this._consume(Tokens.COMMA);
  5022. this._builder.addSpace();
  5023. }
  5024. isFirstVariable = false;
  5025. this._expect(Tokens.IDENTIFIER);
  5026. if (this._peek() === Tokens.ASSIGN) {
  5027. this._builder.addSpace();
  5028. this._consume(Tokens.ASSIGN);
  5029. this._builder.addSpace();
  5030. this._parseAssignmentExpression();
  5031. }
  5032. } while (this._peek() === Tokens.COMMA);
  5033. },
  5034.  
  5035. _parseExpressionOrLabelledStatement: function()
  5036. {
  5037. this._parseExpression();
  5038. if (this._peek() === Tokens.COLON) {
  5039. this._expect(Tokens.COLON);
  5040. this._builder.addSpace();
  5041. this._parseStatement();
  5042. }
  5043. this._expectSemicolon();
  5044. },
  5045.  
  5046. _parseIfStatement: function()
  5047. {
  5048. this._expect(Tokens.IF);
  5049. this._builder.addSpace();
  5050. this._expect(Tokens.LPAREN);
  5051. this._parseExpression();
  5052. this._expect(Tokens.RPAREN);
  5053.  
  5054. var isBlock = this._parseStatementOrBlock();
  5055. if (this._peek() === Tokens.ELSE) {
  5056. if (isBlock)
  5057. this._builder.addSpace();
  5058. else
  5059. this._builder.addNewLine();
  5060. this._next();
  5061.  
  5062. if (this._peek() === Tokens.IF) {
  5063. this._builder.addSpace();
  5064. this._parseStatement();
  5065. } else
  5066. this._parseStatementOrBlock();
  5067. }
  5068. },
  5069.  
  5070. _parseContinueStatement: function()
  5071. {
  5072. this._expect(Tokens.CONTINUE);
  5073. var token = this._peek();
  5074. if (!this._hasLineTerminatorBeforeNext() && token !== Tokens.SEMICOLON && token !== Tokens.RBRACE && token !== Tokens.EOS) {
  5075. this._builder.addSpace();
  5076. this._expect(Tokens.IDENTIFIER);
  5077. }
  5078. this._expectSemicolon();
  5079. },
  5080.  
  5081. _parseBreakStatement: function()
  5082. {
  5083. this._expect(Tokens.BREAK);
  5084. var token = this._peek();
  5085. if (!this._hasLineTerminatorBeforeNext() && token !== Tokens.SEMICOLON && token !== Tokens.RBRACE && token !== Tokens.EOS) {
  5086. this._builder.addSpace();
  5087. this._expect(Tokens.IDENTIFIER);
  5088. }
  5089. this._expectSemicolon();
  5090. },
  5091.  
  5092. _parseReturnStatement: function()
  5093. {
  5094. this._expect(Tokens.RETURN);
  5095. var token = this._peek();
  5096. if (!this._hasLineTerminatorBeforeNext() && token !== Tokens.SEMICOLON && token !== Tokens.RBRACE && token !== Tokens.EOS) {
  5097. this._builder.addSpace();
  5098. this._parseExpression();
  5099. }
  5100. this._expectSemicolon();
  5101. },
  5102.  
  5103. _parseWithStatement: function()
  5104. {
  5105. this._expect(Tokens.WITH);
  5106. this._builder.addSpace();
  5107. this._expect(Tokens.LPAREN);
  5108. this._parseExpression();
  5109. this._expect(Tokens.RPAREN);
  5110. this._parseStatementOrBlock();
  5111. },
  5112.  
  5113. _parseCaseClause: function()
  5114. {
  5115. if (this._peek() === Tokens.CASE) {
  5116. this._expect(Tokens.CASE);
  5117. this._builder.addSpace();
  5118. this._parseExpression();
  5119. } else
  5120. this._expect(Tokens.DEFAULT);
  5121. this._expect(Tokens.COLON);
  5122. this._builder.addNewLine();
  5123.  
  5124. this._builder.increaseNestingLevel();
  5125. while (this._peek() !== Tokens.CASE && this._peek() !== Tokens.DEFAULT && this._peek() !== Tokens.RBRACE) {
  5126. this._parseStatement();
  5127. this._builder.addNewLine();
  5128. }
  5129. this._builder.decreaseNestingLevel();
  5130. },
  5131.  
  5132. _parseSwitchStatement: function()
  5133. {
  5134. this._expect(Tokens.SWITCH);
  5135. this._builder.addSpace();
  5136. this._expect(Tokens.LPAREN);
  5137. this._parseExpression();
  5138. this._expect(Tokens.RPAREN);
  5139. this._builder.addSpace();
  5140.  
  5141. this._expect(Tokens.LBRACE);
  5142. this._builder.addNewLine();
  5143. this._builder.increaseNestingLevel();
  5144. while (this._peek() !== Tokens.RBRACE)
  5145. this._parseCaseClause();
  5146. this._builder.decreaseNestingLevel();
  5147. this._expect(Tokens.RBRACE);
  5148. },
  5149.  
  5150. _parseThrowStatement: function()
  5151. {
  5152. this._expect(Tokens.THROW);
  5153. this._builder.addSpace();
  5154. this._parseExpression();
  5155. this._expectSemicolon();
  5156. },
  5157.  
  5158. _parseTryStatement: function()
  5159. {
  5160. this._expect(Tokens.TRY);
  5161. this._builder.addSpace();
  5162. this._parseBlock();
  5163.  
  5164. var token = this._peek();
  5165. if (token === Tokens.CATCH) {
  5166. this._builder.addSpace();
  5167. this._consume(Tokens.CATCH);
  5168. this._builder.addSpace();
  5169. this._expect(Tokens.LPAREN);
  5170. this._expect(Tokens.IDENTIFIER);
  5171. this._expect(Tokens.RPAREN);
  5172. this._builder.addSpace();
  5173. this._parseBlock();
  5174. token = this._peek();
  5175. }
  5176.  
  5177. if (token === Tokens.FINALLY) {
  5178. this._consume(Tokens.FINALLY);
  5179. this._builder.addSpace();
  5180. this._parseBlock();
  5181. }
  5182. },
  5183.  
  5184. _parseDoWhileStatement: function()
  5185. {
  5186. this._expect(Tokens.DO);
  5187. var isBlock = this._parseStatementOrBlock();
  5188. if (isBlock)
  5189. this._builder.addSpace();
  5190. else
  5191. this._builder.addNewLine();
  5192. this._expect(Tokens.WHILE);
  5193. this._builder.addSpace();
  5194. this._expect(Tokens.LPAREN);
  5195. this._parseExpression();
  5196. this._expect(Tokens.RPAREN);
  5197. this._expectSemicolon();
  5198. },
  5199.  
  5200. _parseWhileStatement: function()
  5201. {
  5202. this._expect(Tokens.WHILE);
  5203. this._builder.addSpace();
  5204. this._expect(Tokens.LPAREN);
  5205. this._parseExpression();
  5206. this._expect(Tokens.RPAREN);
  5207. this._parseStatementOrBlock();
  5208. },
  5209.  
  5210. _parseForStatement: function()
  5211. {
  5212. this._expect(Tokens.FOR);
  5213. this._builder.addSpace();
  5214. this._expect(Tokens.LPAREN);
  5215. if (this._peek() !== Tokens.SEMICOLON) {
  5216. if (this._peek() === Tokens.VAR || this._peek() === Tokens.CONST) {
  5217. this._parseVariableDeclarations();
  5218. if (this._peek() === Tokens.IN) {
  5219. this._builder.addSpace();
  5220. this._consume(Tokens.IN);
  5221. this._builder.addSpace();
  5222. this._parseExpression();
  5223. }
  5224. } else
  5225. this._parseExpression();
  5226. }
  5227.  
  5228. if (this._peek() !== Tokens.RPAREN) {
  5229. this._expect(Tokens.SEMICOLON);
  5230. this._builder.addSpace();
  5231. if (this._peek() !== Tokens.SEMICOLON)
  5232. this._parseExpression();
  5233. this._expect(Tokens.SEMICOLON);
  5234. this._builder.addSpace();
  5235. if (this._peek() !== Tokens.RPAREN)
  5236. this._parseExpression();
  5237. }
  5238. this._expect(Tokens.RPAREN);
  5239.  
  5240. this._parseStatementOrBlock();
  5241. },
  5242.  
  5243. _parseExpression: function()
  5244. {
  5245. this._parseAssignmentExpression();
  5246. while (this._peek() === Tokens.COMMA) {
  5247. this._expect(Tokens.COMMA);
  5248. this._builder.addSpace();
  5249. this._parseAssignmentExpression();
  5250. }
  5251. },
  5252.  
  5253. _parseAssignmentExpression: function()
  5254. {
  5255. this._parseConditionalExpression();
  5256. var token = this._peek();
  5257. if (Tokens.ASSIGN <= token && token <= Tokens.ASSIGN_MOD) {
  5258. this._builder.addSpace();
  5259. this._next();
  5260. this._builder.addSpace();
  5261. this._parseAssignmentExpression();
  5262. }
  5263. },
  5264.  
  5265. _parseConditionalExpression: function()
  5266. {
  5267. this._parseBinaryExpression();
  5268. if (this._peek() === Tokens.CONDITIONAL) {
  5269. this._builder.addSpace();
  5270. this._consume(Tokens.CONDITIONAL);
  5271. this._builder.addSpace();
  5272. this._parseAssignmentExpression();
  5273. this._builder.addSpace();
  5274. this._expect(Tokens.COLON);
  5275. this._builder.addSpace();
  5276. this._parseAssignmentExpression();
  5277. }
  5278. },
  5279.  
  5280. _parseBinaryExpression: function()
  5281. {
  5282. this._parseUnaryExpression();
  5283. var token = this._peek();
  5284. while (Tokens.OR <= token && token <= Tokens.IN) {
  5285. this._builder.addSpace();
  5286. this._next();
  5287. this._builder.addSpace();
  5288. this._parseBinaryExpression();
  5289. token = this._peek();
  5290. }
  5291. },
  5292.  
  5293. _parseUnaryExpression: function()
  5294. {
  5295. var token = this._peek();
  5296. if ((Tokens.NOT <= token && token <= Tokens.VOID) || token === Tokens.ADD || token === Tokens.SUB || token ===  Tokens.INC || token === Tokens.DEC) {
  5297. this._next();
  5298. if (token === Tokens.DELETE || token === Tokens.TYPEOF || token === Tokens.VOID)
  5299. this._builder.addSpace();
  5300. this._parseUnaryExpression();
  5301. } else
  5302. return this._parsePostfixExpression();
  5303. },
  5304.  
  5305. _parsePostfixExpression: function()
  5306. {
  5307. this._parseLeftHandSideExpression();
  5308. var token = this._peek();
  5309. if (!this._hasLineTerminatorBeforeNext() && (token === Tokens.INC || token === Tokens.DEC))
  5310. this._next();
  5311. },
  5312.  
  5313. _parseLeftHandSideExpression: function()
  5314. {
  5315. if (this._peek() === Tokens.NEW)
  5316. this._parseNewExpression();
  5317. else
  5318. this._parseMemberExpression();
  5319.  
  5320. while (true) {
  5321. switch (this._peek()) {
  5322. case Tokens.LBRACK:
  5323. this._consume(Tokens.LBRACK);
  5324. this._parseExpression();
  5325. this._expect(Tokens.RBRACK);
  5326. break;
  5327.  
  5328. case Tokens.LPAREN:
  5329. this._parseArguments();
  5330. break;
  5331.  
  5332. case Tokens.PERIOD:
  5333. this._consume(Tokens.PERIOD);
  5334. this._expect(Tokens.IDENTIFIER);
  5335. break;
  5336.  
  5337. default:
  5338. return;
  5339. }
  5340. }
  5341. },
  5342.  
  5343. _parseNewExpression: function()
  5344. {
  5345. this._expect(Tokens.NEW);
  5346. this._builder.addSpace();
  5347. if (this._peek() === Tokens.NEW)
  5348. this._parseNewExpression();
  5349. else
  5350. this._parseMemberExpression();
  5351. },
  5352.  
  5353. _parseMemberExpression: function()
  5354. {
  5355. if (this._peek() === Tokens.FUNCTION) {
  5356. this._expect(Tokens.FUNCTION);
  5357. if (this._peek() === Tokens.IDENTIFIER) {
  5358. this._builder.addSpace();
  5359. this._expect(Tokens.IDENTIFIER);
  5360. }
  5361. this._parseFunctionLiteral();
  5362. } else
  5363. this._parsePrimaryExpression();
  5364.  
  5365. while (true) {
  5366. switch (this._peek()) {
  5367. case Tokens.LBRACK:
  5368. this._consume(Tokens.LBRACK);
  5369. this._parseExpression();
  5370. this._expect(Tokens.RBRACK);
  5371. break;
  5372.  
  5373. case Tokens.PERIOD:
  5374. this._consume(Tokens.PERIOD);
  5375. this._expect(Tokens.IDENTIFIER);
  5376. break;
  5377.  
  5378. case Tokens.LPAREN:
  5379. this._parseArguments();
  5380. break;
  5381.  
  5382. default:
  5383. return;
  5384. }
  5385. }
  5386. },
  5387.  
  5388. _parseDebuggerStatement: function()
  5389. {
  5390. this._expect(Tokens.DEBUGGER);
  5391. this._expectSemicolon();
  5392. },
  5393.  
  5394. _parsePrimaryExpression: function()
  5395. {
  5396. switch (this._peek()) {
  5397. case Tokens.THIS:
  5398. return this._consume(Tokens.THIS);
  5399. case Tokens.NULL_LITERAL:
  5400. return this._consume(Tokens.NULL_LITERAL);
  5401. case Tokens.TRUE_LITERAL:
  5402. return this._consume(Tokens.TRUE_LITERAL);
  5403. case Tokens.FALSE_LITERAL:
  5404. return this._consume(Tokens.FALSE_LITERAL);
  5405. case Tokens.IDENTIFIER:
  5406. return this._consume(Tokens.IDENTIFIER);
  5407. case Tokens.NUMBER:
  5408. return this._consume(Tokens.NUMBER);
  5409. case Tokens.STRING:
  5410. return this._consume(Tokens.STRING);
  5411. case Tokens.ASSIGN_DIV:
  5412. return this._parseRegExpLiteral();
  5413. case Tokens.DIV:
  5414. return this._parseRegExpLiteral();
  5415. case Tokens.LBRACK:
  5416. return this._parseArrayLiteral();
  5417. case Tokens.LBRACE:
  5418. return this._parseObjectLiteral();
  5419. case Tokens.LPAREN:
  5420. this._consume(Tokens.LPAREN);
  5421. this._parseExpression();
  5422. this._expect(Tokens.RPAREN);
  5423. return;
  5424. default:
  5425. return this._next();
  5426. }
  5427. },
  5428.  
  5429. _parseArrayLiteral: function()
  5430. {
  5431. this._expect(Tokens.LBRACK);
  5432. this._builder.increaseNestingLevel();
  5433. while (this._peek() !== Tokens.RBRACK) {
  5434. if (this._peek() !== Tokens.COMMA)
  5435. this._parseAssignmentExpression();
  5436. if (this._peek() !== Tokens.RBRACK) {
  5437. this._expect(Tokens.COMMA);
  5438. this._builder.addSpace();
  5439. }
  5440. }
  5441. this._builder.decreaseNestingLevel();
  5442. this._expect(Tokens.RBRACK);
  5443. },
  5444.  
  5445. _parseObjectLiteralGetSet: function()
  5446. {
  5447. var token = this._peek();
  5448. if (token === Tokens.IDENTIFIER || token === Tokens.NUMBER || token === Tokens.STRING ||
  5449. Tokens.DELETE <= token && token <= Tokens.FALSE_LITERAL ||
  5450. token === Tokens.INSTANCEOF || token === Tokens.IN || token === Tokens.CONST) {
  5451. this._next();
  5452. this._parseFunctionLiteral();
  5453. }
  5454. },
  5455.  
  5456. _parseObjectLiteral: function()
  5457. {
  5458. this._expect(Tokens.LBRACE);
  5459. this._builder.increaseNestingLevel();
  5460. while (this._peek() !== Tokens.RBRACE) {
  5461. var token = this._peek();
  5462. switch (token) {
  5463. case Tokens.IDENTIFIER:
  5464. this._consume(Tokens.IDENTIFIER);
  5465. var name = this._token.value;
  5466. if ((name === "get" || name === "set") && this._peek() !== Tokens.COLON) {
  5467. this._builder.addSpace();
  5468. this._parseObjectLiteralGetSet();
  5469. if (this._peek() !== Tokens.RBRACE) {
  5470. this._expect(Tokens.COMMA);
  5471. }
  5472. continue;
  5473. }
  5474. break;
  5475.  
  5476. case Tokens.STRING:
  5477. this._consume(Tokens.STRING);
  5478. break;
  5479.  
  5480. case Tokens.NUMBER:
  5481. this._consume(Tokens.NUMBER);
  5482. break;
  5483.  
  5484. default:
  5485. this._next();
  5486. }
  5487.  
  5488. this._expect(Tokens.COLON);
  5489. this._builder.addSpace();
  5490. this._parseAssignmentExpression();
  5491. if (this._peek() !== Tokens.RBRACE) {
  5492. this._expect(Tokens.COMMA);
  5493. }
  5494. }
  5495. this._builder.decreaseNestingLevel();
  5496.  
  5497. this._expect(Tokens.RBRACE);
  5498. },
  5499.  
  5500. _parseRegExpLiteral: function()
  5501. {
  5502. if (this._nextToken.type === "regexp")
  5503. this._next();
  5504. else {
  5505. this._forceRegexp = true;
  5506. this._next();
  5507. }
  5508. },
  5509.  
  5510. _parseArguments: function()
  5511. {
  5512. this._expect(Tokens.LPAREN);
  5513. var done = (this._peek() === Tokens.RPAREN);
  5514. while (!done) {
  5515. this._parseAssignmentExpression();
  5516. done = (this._peek() === Tokens.RPAREN);
  5517. if (!done) {
  5518. this._expect(Tokens.COMMA);
  5519. this._builder.addSpace();
  5520. }
  5521. }
  5522. this._expect(Tokens.RPAREN);
  5523. },
  5524.  
  5525. _parseFunctionLiteral: function()
  5526. {
  5527. this._expect(Tokens.LPAREN);
  5528. var done = (this._peek() === Tokens.RPAREN);
  5529. while (!done) {
  5530. this._expect(Tokens.IDENTIFIER);
  5531. done = (this._peek() === Tokens.RPAREN);
  5532. if (!done) {
  5533. this._expect(Tokens.COMMA);
  5534. this._builder.addSpace();
  5535. }
  5536. }
  5537. this._expect(Tokens.RPAREN);
  5538. this._builder.addSpace();
  5539.  
  5540. this._expect(Tokens.LBRACE);
  5541. this._builder.addNewLine();
  5542. this._builder.increaseNestingLevel();
  5543. this._parseSourceElements(Tokens.RBRACE);
  5544. this._builder.decreaseNestingLevel();
  5545. this._expect(Tokens.RBRACE);
  5546. }
  5547. }
  5548. ;
  5549.